Liferay Portal 4.

0 - Developers Guide
Joseph Shum Alexander Chow

Liferay Portal 4.0 - Developers Guide
Joseph Shum Alexander Chow

...... 6 Jetty 5.......................................................................................... 31 DB2 ....x/5.....................................................................................................0................................................................................... 53 MySQL .............................................................................. 106 JBoss+Tomcat ................................................................................................0 ............................................................................................... Installation and Setup .............................................14 ......................1 ....................................................................... 18 Resin 3................................................1 SP4 ..............................................1....................................... 105 JBoss+Jetty ........ 37 Hypersonic ... 47 JDataStore ..................................... 1 Setting up the Development Environment ................................................................................................................................................................. 17 Pramati 4........................................................................................................................................................................................2........................................................................................... 27 WebSphere 5............................................................... 11 JOnAS+Tomcat 4................................................................................................ 4 JBoss+Tomcat 4............. 3 GlassFish ................................................................... 26 WebSphere 6............................... 3 Geronimo .................................................................................................................................................0........................................ 8 JFox ............................................................... 80 Upgrade to new versions of Liferay ......0................................ 14 OracleAS 10.............................................................................................................................................................. 86 Cyrus IMAP+Postfix .............................................................................................................................................................. 13 JRun 4 Updater 3 .....22 ...................6 ................................................................. 75 SQL Server ......................................................................... 19 RexIP 2................................................................................................... 85 Run the upgrade scripts .................... 106 iv ..........................................................................................6........................................................ 31 Firebird ..0.. 11 JOnAS+Jetty 4............................. 2 2................................................6 ........................................................0.............. 86 Washington IMAP+Sendmail ..................................................3 ....................................0................................ 1 Jikes 1...0 .............................. 90 Dovecot+Postfix ...............................................................................................................................................5 .....4...................................................0...................................................2 ..................................................................................................................................................................... 1 Orion 2......... 1 JDK 1..............................................................................................1 ................. 3 Borland ES 6............................2 .............................................................................. Getting Started .........0............................................................................................................................................................................... 86 Upgrading Themes from 3........................................................................ 69 SAP ..................................................5.................................................. 86 Mail Servers .............................................................5 ............ 1 Ant 1................. 29 Databases ............................................................. 58 Oracle ............4...................... 3 Application Servers ....5 ....................................................................4 ................................................................................................ 21 Sun JSAS 8....................................................................................................5 .01 ........................................................................................................................... 64 PostgreSQL ..................................................................................................5.......................................................1................................................................6...................................................................................... 105 Multiple Portal Instances ....1 to 4...................................................... vi 1...................... 1 SVN .........................................................................................................................................................Table of Contents Preface ........................................................ 23 WebLogic 8............................................................................................................ 15 Orion 2............................................. 3 JBoss+Jetty 4............. 22 Tomcat 5..............................................................3 ...............................................................................2 ........................................ 42 InterBase .........................x ........................................................................................................................................................................................................... 85 Regenerate classes ....................................................................... 96 Microsoft Exchange .

......................................................................... CSS Styles ................................................ Hello World ........................ 5....................................................................... Using your own Security System in Liferay .................................1 to 4...................................................................................... Customizing the Portal ..............................................................................................................................0 ............. Themes .............................................................................................................................................................................................................................. Upgrading Themes from 3............................................................................................................................................... Code Generation ............................................................................................................................................ /ext/ext-ear ......... Should I use Velocity or JSP? ................................................................................................................................. 3........................................ Tomcat ................. CMS + Portal = Website .......................... Checking Permissions ....................................................................... Making Your Own Theme ..................................................................................................... Adding Resources .................................................................................... 107 107 108 109 109 109 110 110 110 110 111 111 111 111 111 112 113 113 113 113 113 114 115 117 117 119 120 122 125 126 126 131 131 131 132 132 132 132 132 135 136 137 141 141 141 141 141 143 143 143 144 146 147 148 151 v .. 6...6............ 7.......................................................................... Why Hot-Deployable Themes must use Velocity Templates: ..........................................................................JSP ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................0 ... Portlets ............................................................................... 8......... Implementing Permissions ......................................................... /ext/lib ...................................................................................................... /ext/sql ............................................................................................................................................................................0........0.................. Code Conventions ......................................... service...................................................................................................................... Configuration ........0 ................................. Themes .............................................................................................. Conclusion .................................................................................................. /ext/ext-lib ................. Additional Information ............................... /ext/downloads .............................0.............................................................................. /ext ........................... Summary .................................. /ext/web-sites ......................................................................................................................................... Tutorials ...........................................Developers Guide Jetty ...... /ext/ext-ejb ........................................... 4..................... Roles .................Liferay Portal 3................................ Security and Permissions ....................................................... Hot Deploy ...................................................................... Calendar .................................................................................................6........................................................................................................ Templates .................................................. Orion ......................................... Introduction ..............................6.........................................................................................Liferay Portal 4......................................................Velocity ....................................................................................... Message Boards .................................................. /ext/ext-web ............................... Overview ..........0 ......................................................................................................................Liferay Portal 4........................ Upgrading Themes from 3.......... Deployment ..................... Portlets and Themes ........................................................................... /ext/servers ................................................................................... Eclipse .....................................................................................xml ................................................................. 9..................................................................................... Defining Resources and Actions .......................................................................................................1 to 4.......................................... Database Schema View .................................................................................................... Layout Templates.................................................................... Building Themes ........................................... IFrame ...................................................................................... Mail ......................................................................................................................................................................................................................................................................................................................................... Adding Permission ..................................................... /ext/portlets .....................................................................1 .............

We also offer professional support services where your company can be assigned a Liferay developer that will ensure that your questions are answered promptly so that your project is never compromised.liferay. This business model allows us to build a company that can contribute a great portal to the open source community. It is still a work in progress and will be updated frequently with new content. rename it. If you find a bug or have a new feature request.com].net/lists/listinfo/lportal-development] or Browse [http://sourceforge.0. and sell it under your name. which means you can rebundle Liferay.com] so the community can have a better place to discuss their experiences with Liferay.net/mailarchive/forum. its threading is limited and does not allow you to continue a conversation that started a few months ago. please consider purchasing support.sourceforge. Our only source of revenue is from professional support and consulting. Contributions are welcome.liferay. We believe free means you can do whatever you want with it.Preface This document is intended as a reference guide for developers of Liferay Portal 4.liferay.com Tracker: http://support.com Mailing List: Subscribe [http://lists. If your company uses Liferay. Need Help? Forums: http://forums.php?forum=lportal-development] Please search through the mailing list first if you have an issue. please post it on our tracker [http://support. Topic suggestions are also welcome. Purchased support always gets first priority. very similar to Apache and BSD).liferay. We've switched to user forums [http://forums. vi . Please email <support@liferay.com> to provide documents that you have written and would like to contribute back to the community. Liferay has an extremely liberal license model (MIT. However. The mailing list contains a lot of information because we've been using it for many years.

Ant 1. configure SmartSVN to use the https protocol to connect to svn. Set an environment variable called %ANT_HOME% to point to your Ant directory. 1 . Jikes 1. Authenticate as user anonymous with a blank password and specify /svnroot/lportal/portal as the UNIX path.4 also and a wide array of application servers and containers.0 [http://java.apache.ibm. Before we can get started.5. configure SmartSVN to use the https protocol to connect to svn.5.22 [http://www-124. Set an environment variable called %JIKES_HOME% to point to your Jikes directory.com/j2se/1.5 developing with Java JDK 1. Add %JIKES_HOME%\bin to your %PATH% environment variable.sun. Download and install JDK 1. SVN 1.5 1. If you are a developer with privileges to commit to the source tree. 3.net. the following conponents must be installed on your machine.sourceforge. Download and unzip the latest version of Ant [http://ant.com/developerworks/oss/jikes].smartsvn. 2.6. These instructions are specific to setting up for deployment to Orion server and Tomcat 5.0/download. You will need to adjust your development environment according to your platform. Add %ANT_HOME%\bin to your %PATH% environment variable. Download and install SmartSVN [http://www. 2. 3.jsp].org/]. Authenticate with your private user and password and specify / svnroot/lportal/portal as the UNIX path. 3. 2.22 1. JDK 1.5. Liferay is compatible with Java 1. Getting Started Setting up the Development Environment The following instructions will help you get your development environment ready for working with the source code.Chapter 1.0 1. 2.sourceforge.com/]. Check out the portal. Set an environment variable called %JAVA_HOME% to point to your JDK directory. Download and unzip Jikes 1.net. If you wish to browse the source tree.5.

6.name}. download run.server.ctx with the value /portal. If you are developing in a Windows environment. 7.com/3. Remove the config directory from Orion.zip [http://content. Add the property portal.sh [http://content.liferay.1/config. Run ant start at least once to compile the source files and to generate all database scripts and skin images.6 1. 2 .sh] to the Orion directory and execute the script after everything is properly deployed with Ant.6.liferay.6.properties.bat [http://content. 9. This properties file is later referenced by Ant so it knows where to deploy the application. The variable ${user.server.bat] to the Orion directory and execute the batch file after everything is properly deployed with Ant.com/3. Overload the properties with the proper directory for Orion.properties modeled after app. Orion 2. run ant deploy to copy all the necessary files to Orion.xml to make sure the server can find the proper location of Jikes.com/3.1/run. which is in the checked out SVN directory.0. 8.6 [???]. Tasks can be run at the root of the project directory and inside each subproject directory. Download config.zip] and unzip the new config directory into Orion.${user. 3.6. Edit /config/datasources. Learn how tasks work in Ant.liferay.1/run. Create a separate properties file named app. 4. Go to D:\svnroot\liferay\portal. Create a file named D:\svnroot\liferay\portal\util-java\classes\portal-ext.0. 2.name} is the user name you used to log into your operating system. Edit /config/server. Populate your database with the portal schema and default data.properties. 5. 5. Download and unzip Orion 2. download run.Getting Started 4. After running ant start at least once. If you are developing under a UNIX environment.xml to make sure the proper database pool is created.

For example. unzip it. simply download our bundle with precompiled JSPs.borland.Chapter 2. You only need to set the locations of the IMAP.com/j2se/1. Deploy liferay-portal-ent-4. Installation and Setup Application Servers Liferay Portal supports many different application servers and servlet containers. if you want to try out Liferay on Jetty. The only difference is that a property setting configures Liferay Portal Enterprise to make all calls through EJBs whereas Liferay Portal Professional makes all calls through POJOs.4.ear].ear [http://prdownloads.2 [http://java. Create a mail session bound to mail/MailSession.0. Configure data sources for your database.sourceforge.0.2] .borland. Open your browser to http://localhost:8080. and JFox in as soon as possible. POP3. We also detail the steps taken to configure these containers for use with Liferay. We offer you choices so that those who need the benefit of EJBs can have it.sun. Borland ES 6. Follow the instructions [http://info. We have tried to make the installation process as easy as possible by including a bundled version of Liferay with our supported open source containers.com/devsupport/bes/faq/6. Make sure the JDBC driver for your database is accessible by Borland ES.0. and run it.4. Geronimo We plan on adding support for Geronimo as soon as possible.5/portal/liferay. Click on Sign In at the upper right hand corner to enter the login screen.ear. Download liferay-portal-ent-4.net/lportal/liferay-portal-ent-4. GlassFish. It already comes with a built in Java database so you have to do the least amount of configuration. The source code is identical in both versions. and SMTP servers. Expert. Populate your database with the portal schema and default data. GlassFish 3 .html] from Borland.0.5 • • • • • • • • • Download and install JDK 1.0.com/]. Please contact us if you would like to help us in this effort. Set an environment variable called %JAVA_HOME% to point to your JDK directory. Please contact us if you would like to help us in this effort. Some instructions are separated as Easy vs.com and your password is test. Liferay Portal Enterprise requires a fully compliant J2EE application server whereas Liferay Portal Professional can run in a simple servlet container. Your login is test@liferay. and those who don't want the overhead of EJBs don't have to pay for it.0. We also plan on adding support for Geronimo. Download and install Borland ES [http://www.

0-jboss-jetty.sar.0. You must start the executable from the directory where it resides.zip].sar.com/j2se/1.4. 4 . the batch file to start the server will end with the extension sh instead of bat.0. Execute C:\LIFERAY\bin\run.2] . Remove /server/default/deploy/management. Be sure to unzip with folder names.4-jboss-4.sourceforge. Set an environment variable called %JAVA_HOME% to point to your JDK directory.4. Click on My Liferay at the upper right hand corner to enter the login screen.1.0.0.0.com/j2se/1.com and your password is test. Unzip liferay-portal-ent-4.2 [http://java.2 [http://java. Make sure there isn't another application already using port 8080.1. Expert • • • • • Download and install JDK 1.Installation and Setup We plan on adding support for GlassFish as soon as possible.bat to run the database and web server.0-jboss-jetty.4-jboss-4.0-jboss-jetty.zip to C:\LIFERAY (or any another directory). Download liferay-portal-ent-4. Make sure to chmod the batch file so you can execute it.net/lportal/liferay-portal-ent-4. • Open your browser to http://localhost:8080 [http://localhost:8080/].4.sourceforge. Remove /server/default/deploy/jbossweb-tomcat55.ear].sourceforge. When in a Unix environment.0. Set an environment variable called %JAVA_HOME% to point to your JDK directory.0. Download liferay-portal-ent-4.0. Download and install JBoss+Jetty [http://www.zip [http://prdownloads. Populate your database with the portal schema and default data.0.4.org/].sar?download] and unjar it to /server/default/deploy/jbossweb-jetty.xml: <classpath codebase="lib/ext" archives="*"/> • Download jetty-5.net/jetty/jetty-5.2 Easy • • • • Download and install JDK 1.0. Please contact us if you would like to help us in this effort.sar.net/lportal/liferay-portal-ent-4.ear [http://prdownloads. Remove /server/default/deploy/jboss-ws4ee.2] . Add to /server/default/conf/jboss-service.sun.sar [http://prdownloads.jboss. Your login is test@liferay.sun.2. JBoss+Jetty 4.2.

. 5 .jboss.host" value="localhost" /> </configuration> </attribute> </mbean> • Configure JAAS.auth.. This is a known vulnerability that will allow hackers to retrieve your database settings.UsersRolesLoginModule" flag = "required" /> .web.0.xml and comment out the entire XML for policy other.host" value="localhost" /> <property name="mail.xml.protocol" value="smtp" /> <property name="mail. Leaving it at the default value of true allows anyone to download your JBoss configuration files.0.spi. Create a mail session bound to mail/MailSession. Edit /server/default/conf/login-config. Set the proper mail properties by editing /server/default/deploy/mail-service. <attribute name="DownloadServerClasses">false</attribute> • • Configure data sources for your database. Edit /server/default/conf/jboss-service.protocol" value="imap" /> <property name="mail.smtp.ear. You only need to set the locations of the IMAP.xml. <mbean code="org.scanner. Copy liferay-portal-ent-4..security. Edit /server/default/conf/jboss-service.mail.MailService" name="jboss:service=MailSession"> <attribute name="JNDIName">mail/MailSession</attribute> <attribute name="User">nobody</attribute> <attribute name="Password">password</attribute> <attribute name="Configuration"> <configuration> <property name="mail. <login-module code="org. </application-policy>--> • Deploy liferay-portal-ent-4.host" value="localhost" /> <property name="mail. POP3.store.. <attribute name="URLComparator">org. <!--<application-policy name = "other"> .deployment.jboss.pop3.ear to /server/default/deploy.xml. Make sure the JDBC driver for your database is accessible by JBoss+Jetty.transport.PrefixDeploymentSorter</attribute> • Find the org.Installation and Setup • Use the prefix deployment sorter instead of the default deployment sorter. and SMTP servers.0. etc.WebService MBean that listens on port 8083 and do not allow it send configuration files and other resources.0.imap.jboss.jboss.

2 [http://java.com and your password is test.2 [http://java.sar/ROOT. Set an environment variable called %JAVA_HOME% to point to your JDK directory. Populate your database with the portal schema and default data. the batch file to start the server will end with the extension sh instead of bat. Your login is test@liferay.xml.sun. Expert • • • • • Download and install JDK 1. You must start the executable from the directory where it resides.0.jboss. Edit /server/default/deploy/jbossweb-tomcat55.0.com and your password is test.OutOfMemoryError exception while starting up JBoss+Jetty.sar/conf/web. • Open your browser to http://localhost:8080.sun. Click on My Liferay at the upper right hand corner to enter the login screen.com/j2se/1.0.Installation and Setup • Start JBoss+Jetty.2 Easy • • • • Download and install JDK 1. If you get a java.2] .net/lportal/liferay-portal-ent-4.zip [http://prdownloads.4.0. Download liferay-portal-ent-4. Add to /server/default/conf/jboss-service. Make sure that there isn't another application using port 8080. Your login is test@liferay.0.4. When in a Unix environment. give your JVM more memory by setting -Xmx512m.0-jboss-tomcat.bat to run the database and web server.sourceforge.ear [http://prdownloads.xml: <classpath codebase="lib/ext" archives="*"/> • Remove /server/default/deploy/jbossweb-tomcat55.org/]. Download and install JBoss+Tomcat [http://www.0-jboss-tomcat.net/lportal/liferay-portal-ent-4. Click on My Liferay at the upper right hand corner to enter the login screen. JBoss+Tomcat 4.war.sourceforge.lang.0. Be sure to unzip with folder names. Download liferay-portal-ent-4.zip to C:\LIFERAY (or any another directory). Make sure to chmod the batch file so you can execute it.zip]. Execute C:\LIFERAY\bin\run.4. Unzip liferay-portal-ent-4.0.com/j2se/1.0-jboss-tomcat. • Open your browser to http://localhost:8080.2] .4. 6 .ear]. Set an environment variable called %JAVA_HOME% to point to your JDK directory.0.

store.PrefixDeploymentSorter</attribute> • Find the org.host" value="localhost" /> <property name="mail. Make sure the JDBC driver for your database is accessible by JBoss+Tomcat. Edit /server/default/conf/jboss-service. Edit /server/default/conf/jboss-service.xml.mail. POP3. <attribute name="URLComparator">org.WebService MBean that listens on port 8083 and do not allow it send configuration files and other resources.xml.protocol" value="imap" /> <property name="mail.host" value="localhost" /> <property name="mail.MailService" name="jboss:service=MailSession"> <attribute name="JNDIName">mail/MailSession</attribute> <attribute name="User">nobody</attribute> <attribute name="Password">password</attribute> <attribute name="Configuration"> <configuration> <property name="mail. <attribute name="DownloadServerClasses">false</attribute> • • Configure data sources for your database. <mbean code="org.host" value="localhost" /> </configuration> </attribute> 7 .xml.Installation and Setup <init-param> <param-name>listings</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>input</param-name> <param-value>4096</param-value> </init-param> <init-param> <param-name>output</param-name> <param-value>4096</param-value> </init-param> Edit /server/default/deploy/jbossweb-tomcat55. This is a known vulnerability that would allow hackers to retrieve your database settings.web.jboss. Leaving it at the default value of true allows anyone to download your JBoss configuration files.scanner. etc.protocol" value="smtp" /> <property name="mail.sar/META-INF/jboss-service.transport.smtp.pop3.deployment.jboss.xml. Set the proper mail properties by editing /server/default/deploy/mail-service.imap. You only need to set the locations of the IMAP. <attribute name="Java2ClassLoadingCompliance">true</attribute> <attribute name="UseJBossWebLoader">true</attribute> • Use the prefix deployment sorter instead of the default deployment sorter.jboss. and SMTP servers. Create a mail session bound to mail/MailSession.

zip [http://prdownloads. • Start JBoss+Tomcat.auth.com and your password is test.sun.2 [http://java. • Open your browser to http://localhost:8080.. Download liferay-portal-pro-4.ear to /server/default/deploy.0.4. Your login is test@liferay.. </application-policy>--> • Deploy liferay-portal-ent-4. Make sure to chmod the batch file so you can execute it. If you get a java. the batch file to start the server will end with the extension sh instead of bat.Installation and Setup </mbean> • Configure JAAS.ear.sourceforge.2] .com and your password is test.0. give your JVM more memory by setting -Xmx512m.0.0.zip]. When in a Unix environment.liferay.pdf].spi.net/lportal/liferay-portal-pro-4.0. • • Open your browser to http://localhost:8080. <!--<application-policy name = "other"> . Copy liferay-portal-ent-4. Set an environment variable called %JAVA_HOME% to point to your JDK directory. Click on My Liferay at the upper right hand corner to enter the login screen. Execute C:\LIFERAY\bin\run.zip to C:\LIFERAY (or any another directory).security. Click on My Liferay at the upper right hand corner to enter the login screen. You can set up JBoss+Tomcat behind Apache using mod_jk2 by following the instructions in this document [http://content.lang. Be sure to unzip with folder names.0-jetty. <login-module code="org. Edit /server/default/conf/login-config.OutOfMemoryError exception while starting up JBoss+Tomcat.. You must start the executable from the directory where it resides.1.xml and comment out the entire XML for policy other.4.4 Easy • • • • Download and install JDK 1.jboss. Unzip liferay-portal-pro-4. Make sure there isn't another application using port 8080.com/document/Liferay_on_JBoss+Tomcat+Apache.0.com/j2se/1.0-jetty.UsersRolesLoginModule" flag = "required" /> . Your login is test@liferay.0-jetty. 8 . Jetty 5.0..bat to run the database and web server.

protocol">smtp</Put> <Put name="mail.home)/lib/ext/* • • Configure data sources for your database.Installation and Setup Expert • • Download and install JDK 1.Server"> <Call name="addWebApplication"> <Arg>/</Arg> <Arg>.war [http://prdownloads.xml</Set> <Set name="classLoaderJava2Compliant">true</Set> </Call> </Configure> • • • Download liferay-portal-pro-4. Set an environment variable called %JAVA_HOME% to point to your JDK directory.smtp.jetty.plus.com/j2se/1.0.host">localhost</Put> </New> </Arg> </Call> • Configure JAAS.xml and configure a mail session. Edit /etc/jetty.4 -all.net/lportal/liferay-portal-pro-4.host">localhost</Put> <Put name="mail.jetty.4.jettyserver.4. 9 . Get jetty-5.store.pop3. POP3.0. <Configure class="org.0.mortbay. Create a mail session bound to mail/MailSession.MailService"> <Set name="Name">MailService</Set> <Set name="JNDI">mail/MailSession</Set> <Put name="mail.home)/lib/ext/ $(jetty. Make sure the JDBC driver for your database is accessible by Jetty. You only need to set the locations of the IMAP.xml and configure a security realm.2] .protocol">imap</Put> <Put name="mail.transport.imap.config. <Call name="addService"> <Arg> <New class="org.0.host">localhost</Put> <Put name="mail./liferay</Arg> <Set name="extractWAR">true</Set> <Set name="defaultsDescriptor">org/mortbay/jetty/servlet/webdefault. Populate your database with the portal schema and default data.mortbay.xml to configure the JettyPlus server class and add the portal web application. Edit /extras/etc/start-plus.plus.1.sun.sourceforge.zip because it includes all the required libraries. Download and install Jetty [http://www.2 [http://java.org/].war].. $(jetty. Edit /etc/jetty. and SMTP servers. • Edit /etc/jetty.

jaas.login.jar from /liferay/WEB-INF/lib to /lib/ext.war.war to /liferay. Unpack liferay-portal-pro-4. PortalRealm { com.PortalLoginModule required.0.lang.0.auth.security.0.. <Call name="addWebApplication"> <Arg>/</Arg> <Arg>. Make sure the Java command that starts Jetty sets the location of the JAAS config file as a system property.Installation and Setup <Call name="addWebApplication"> <Arg>/</Arg> ..mortbay. }.war. <Set name="Realm"> <New class="org./liferay</Arg> <Set name="extractWAR">true</Set> <Set name="defaultsDescriptor">org/mortbay/jetty/servlet/webdefault.portal. Move every jar except util-taglib.config • Deploy liferay-portal-pro-4.0.config.xml</Set> <Set name="classLoaderJava2Compliant">true</Set> <Set name="Realm"> <New class="org.jaas.0.0.jaas.config=. This step is only necessary if you plan to hot deploy portlet WARs.. 10 ./etc/jaas. Edit /etc/jetty. Make sure the Java command that starts Jetty sets the location of the Jetty config file as a system property. -Djava.OutOfMemoryError exception while starting up Jetty. give your JVM more memory by setting -Xmx512m.JAASUserRealm"> <Set name="Name">PortalRealm</Set> <Set name="LoginModuleName">PortalRealm</Set> </New> </Set> </Call> • Start Jetty.mortbay.security..xml to tell Jetty where to find liferay-portal-pro-4.liferay.JAASUserRealm"> <Set name="Name">PortalRealm</Set> <Set name="LoginModuleName">PortalRealm</Set> </New> </Set> </Call> Create /etc/jaas. If you get a java.

0.objectweb. Set an environment variable called $JONAS_ROOT to point to where you unzipped JOnAS+Jetty.2] . JFox We plan on adding support for JFox as soon as possible. Set an environment variable called %JONAS_ROOT% to point to where you unzipped liferayportal-ent-4. java -D. Make sure to chmod the batch file so you can execute it.Installation and Setup -DSTART=.4. Be sure to unzip with folder names.3 Easy • • • • • Download and install JDK 1.0. Execute C:\LIFERAY\bin\nt\jonas.4./etc/jetty.2 [http://java.2 [http://java. Set an environment variable called %JAVA_HOME% to point to your JDK directory.4.2] . Expert • • • Download and install JDK 1.0-jonas-jetty.zip to C:\LIFERAY (or any another directory).xml • Open your browser to http://localhost:8080. Download liferay-portal-ent-4..0-jonas-jetty..com/j2se/1./extra/etc/start-plus.. Make sure there isn't another application using port 8080.net/lportal/liferay-portal-ent-4.4. Unzip liferay-portal-ent-4.com and your password is test. Your login is test@liferay.org/]. 11 . Click on My Liferay at the upper right hand corner to enter the login screen.config Jetty also needs to know the location of its main configuration file when you start it.com/j2se/1. You must start the executable from the directory where it resides. • Open your browser to http://localhost:8080.. Click on My Liferay at the upper right hand corner to enter the login screen.zip. -jar .0-jonas-jetty..zip].0. JOnAS+Jetty 4. Your login is test@liferay./start.jar . the batch file to start the server will end with the extension sh instead of bat.4.bat to run the database and web server.zip [http://prdownloads. Please contact us if you would like to help us in this effort. Set an environment variable called %JAVA_HOME% to point to your JDK directory. When in a Unix environment.sun.0. Download and install JOnAS+Jetty [http://jonas.0-jonas-jetty.sourceforge.com and your password is test.sun.

If you get a java. Copy liferay-portal-ent-4.0.0.jar.war. give your JVM more memory by setting -Xmx512m.0. jonas.MF. • Start JOnAS+Jetty. counter-ejb.sourceforge.ear to /apps. Set the proper mail properties by editing /conf/mail-session. • Open your browser to http://localhost:8080.properties and configure the application name. Open up liferay-portal-ent-4.MF with / META-INF/MANIFEST.factory.factories=mail-session • • • Configure JAAS.service.config.mail.security.PortalLoginModule required.transport. Populate your database with the portal schema and default data. Create a mail session bound to mail/MailSession.0.host=localhost mail. jonas.service.portal. Edit /conf/jonas.Installation and Setup • • • Download liferay-portal-ent-4. lockejb. Click on My Liferay at the upper right hand corner to enter the lo12 . Configure data sources for your database.jar.mail.Session mail.jar.ear]. Edit /conf/jaas. jetty { com.host=localhost mail. }.type=javax.0.smtp.ear.0.properties so it knows where to look for your mail properties.jaas.0.JOnAS.ear Remove /webapps/autoload/ctxroot.0.0.xml.0.protocol=imap mail. mail. POP3.jar to replace /META-INF/MANIFEST. mail-ejb. You only need to set the locations of the IMAP.0.ear.OutOfMemoryError exception while starting up JOnAS+Jetty.ear and repackage cache-ejb.ear and repackage portal-web-complete.JOnAS_Jetty.xml with /WEB-INF/web-jetty.factory. documentlibrary-ejb. and SMTP servers.descriptors=liferay-portal-ent-4.0.liferay.host=localhost Edit /conf/jonas.pop3.war and tunnel-web.0. Open up liferay-portal-ent-4.jar.jar. JOnAS has a bug where it hangs if different JARs in an EAR reference each other. Make sure the JDBC driver for your database is accessible by JOnAS+Jetty.name=mail/MailSession mail.imap.store.lang.war to replace / WEB-INF/web-jetty.properties.ear [http://prdownloads. • Deploy liferay-portal-ent-4.0. and portal-ejb.net/lportal/liferay-portal-ent-4.protocol=smtp mail.

0.0. Set an environment variable called %JONAS_ROOT% to point to where you unzipped liferayportal-ent-4. Your login is test@liferay.objectweb.com/j2se/1.0.sun. Download liferay-portal-ent-4. JOnAS has a bug where it hangs if different JARs in an EAR reference each other.jar to replace /META-INF/MANIFEST. Set an environment variable called %JAVA_HOME% to point to your JDK directory.0-jonas-tomcat.net/lportal/liferay-portal-ent-4.2] .0-jonas-tomcat. counter-ejb. and portal-ejb.4.org/]. • Open your browser to http://localhost:8080. the batch file to start the server will end with the extension sh instead of bat.sourceforge.ear and repackage cache-ejb. You only need to set the locations of the IMAP. documentlibrary-ejb.0.zip to C:\LIFERAY (or any another directory). Expert • • • • • • Download and install JDK 1.net/lportal/liferay-portal-ent-4. Execute C:\LIFERAY\bin\nt\jonas. POP3.com and your password is test.MF. Configure data sources for your database. Download liferay-portal-ent-4. Create a mail session bound to mail/MailSession.bat to run the database and web server.4.0-jonas-tomcat. Download and install JOnAS+Tomcat [http://jonas.0.ear [http://prdownloads.2] .0. Unzip liferay-portal-ent-4.zip. Open up liferay-portal-ent-4. Set an environment variable called %JAVA_HOME% to point to your JDK directory.0.sourceforge.4.0.jar.jar.0. When in a Unix environment. Be sure to unzip with folder names. Make sure there isn't another application using port 8080.ear].4. Set an environment variable called $JONAS_ROOT to point to where you unzipped JOnAS+Tomcat. Populate your database with the portal schema and default data.4.Installation and Setup gin screen.JOnAS. Make sure to chmod the batch file so you can execute it.jar. mail-ejb.2 [http://java.jar.MF with / META-INF/MANIFEST.zip]. Your login is test@liferay.0. and SMTP servers.sun.com/j2se/1. You must start the executable from the directory where it resides.com and your password is test JOnAS+Tomcat 4.3 Easy • • • • • Download and install JDK 1.zip [http://prdownloads.jar.2 [http://java.0-jonas-tomcat. Click on My Liferay at the upper right hand corner to enter the login screen. 13 • • . Make sure the JDBC driver for your database is accessible by JOnAS+Tomcat. lockejb.

realm.transport.4.service.ear. give your JVM more memory by setting -Xmx512m.name=mail/MailSession mail.lang.service.protocol=smtp mail.config. Download and install JRun [http://www. <Realm className="org. Copy liferay-portal-ent-4.pop3.ear.smtp.factory. Your login is test@liferay.type=javax.descriptors=liferay-portal-ent-4.4. Click on My Liferay at the upper right hand corner to enter the login screen.OutOfMemoryError exception while starting up JOnAS+Tomcat. Set an environment variable called %JAVA_HOME% to point to your JDK directory.jonas. JRun 4 Updater 3 • • Download and install JDK 1.mail.Session mail.0.com and your password is test.catalina50. Edit /conf/server.0. jonas.properties and configure the application name.sun.0.ear Remove /webapps/autoload/ctxroot.Installation and Setup Set the proper mail properties by editing /conf/mail-session.properties so it knows where to look for your mail properties.2] .imap. 14 . jonas.store.JAAS" /> • Deploy liferay-portal-ent-4.factories=mail-session • Configure JAAS. If you get a java.macromedia.security.mail.host=localhost mail.com/software/jrun/].jaas.0. • Start JOnAS+Tomcat.liferay. Edit /conf/jonas.2 [http://java.properties. Edit /conf/jaas.PortalLoginModule required.com/j2se/1.war.security.portal.ear to /apps. }.factory.0. tomcat { com.protocol=imap mail.objectweb.web. • Open your browser to http://localhost:8080.0. mail.host=localhost mail.xml to use the correct realm.host=localhost Edit /conf/jonas.

give your JVM more memory by setting -Xmx512m. OracleAS 10. POP3. set the user name to userId.com/jrun4docs/JRun_Administrators_Guide/authentic4. set the query string to SELECT 'users'.ear]. Populate your database with the portal schema and default data.security. The dependent libraries are found in /lib inside liferay-portal-ent-4.macromedia. Under user details.2 [http://java.macromedia. Download and install OracleAS [http://www. Click on My Liferay at the upper right hand corner to enter the login screen. COUNT(*) FROM Role_ WHERE roleId NOT LIKE ?. Your login is test@liferay.sun.com/]. Use jrun.4.JDBCLoginModule as your user module class.2] . Point the role module to use jdbc/LiferayPool as the data source. Make sure the JDBC driver for your database is accessible by JRun. • • • • Configure data sources for your database.0. Under user query. Set an environment variable called %JAVA_HOME% to point to your JDK directory.0. Point the user module to use jdbc/LiferayPool as the data source. • Configure JAAS.0.com/j2se/1.0. Remove /servers/default/default-ear.ear. JRun also does not give a correct error message but gives a misleading error message stating that JRun cannot find Jikes. Note Configuring mail sessions may not be necessary if you're using JRun Updater 3. 'Roles'.0. If you get a java. and set the password to password_. The following are links to pages with instructions on how to configure security with JRun.oracle.0. The screen for updating mail sessions seems to be missing from JRun Updater 3 and only available in previous versions.security. You only need to set the locations of the IMAP. Use jrun.4.ear. and SMTP servers.ear after you copy them to /servers/lib.0. Create a mail session bound to mail/MailSession.jsp http://www.com/devnet/server_archive/articles/jrun_authentication.sourceforge.com and your password is test.Installation and Setup • • • Download liferay-portal-ent-4. JRun has a bug where it cannot properly compile JSPs with Jikes in a Windows environment because the Windows command prompt has a size limitation.1.lang.JDBCLoginModule as your role module class.0. Delete the dependent libraries from liferay-portal-ent-4. set the table name to User_. http://livedocs.OutOfMemoryError exception while starting up JRun.html • • Deploy liferay-portal-ent-4.0. Open your browser to http://localhost:8080.2 • • Download and install JDK 1. 15 .net/lportal/liferay-portal-ent-4. Start JRun.ear [http://prdownloads.0.

and configure a user manager.com/tech/java/oc4j/htdocs/OC4J-JSP-FAQ.DataSourceUserManager"> <property name="dataSource" value="jdbc/LiferayPool" /> <property name="table" value="User_" /> <property name="usernameField" value="userId" /> <property name="passwordField" value="password_" /> <property name="defaultGroups" value="users" /> <property name="staleness" value="0" /> </user-manager> • Deploy liferay-portal-ent-4.host" value="localhost" /> <property name="mail.ear].rollerweblogger.host" value="localhost" /> </mail-session> • Configure JAAS. set forgive_dup_dir_attr to true.ear and configure a mail session.protocol" value="smtp" /> <property name="mail.imap. Make sure the JDBC driver for your database is accessible by OracleAS.0. POP3.oracle. and SMTP servers.2 .ear" /> Edit /j2ee/home/config/server.evermind.0.Installation and Setup • The following are links to pages with instructions on how to configure OracleAS to support JDK 1.4.oracle.sql.com-web.0./web-sites/liferay.0. Edit /j2ee/home/config/server.0.com/tech/java/oc4j/htdocs/OC4J-JSP-FAQ. Copy liferay-portal-ent-4.com-web.xml and add a new web site entry.ear.ear.pop3.0.ear to /j2ee/home/applications.0. To workaround this bug.0. Create a mail session bound to mail/MailSession. <user-manager class="com. <web-site path=".0..oracle.0.com/tech/java/oc4j/htdocs/OC4J-JSP-FAQ.0. http://otn.0.xml. Edit orion-application.html http://www.0.xml to tell OracleAS where to find liferay-portal-ent-4.xml.html#Attribute%20defined%20twice] • • • • Download liferay-portal-ent-4.0.html#Attribute%20defined%20twice [http://technet.net/lportal/liferay-portal-ent-4.transport. 16 . Configure data sources for your database.0./applications/liferay-portal-ent-4. Populate your database with the portal schema and default data.xml" /> Create /j2ee/home/config/web-sites/liferay.0. http://technet. <mail-session location="mail/MailSession" smtp-host="localhost"> <property name="mail. You only need to set the locations of the IMAP.ear.sourceforge. <application name="liferay" path=".org/page/roller/20021017 • OracleAS incorrectly detects duplicate page directives.xml. found in liferay-portal-ent-4.ear [http://prdownloads. found in liferay-portal-ent-4. Edit orion-application.

0.sql. and configure a user manager.4.4.pop3.com/].xml. Set an environment variable called %JAVA_HOME% to point to your JDK directory.host" value="localhost" /> <property name="mail. If you get a java. and SMTP servers.com and your password is test. Make sure the JDBC driver for your database is accessible by Orion. give your JVM more memory by setting -Xmx512m.2] . Create a mail session bound to mail/MailSession. Populate your database with the portal schema and default data. found in liferay-portal-ent-4.ear. Orion 2./.net/lportal/liferay-portal-ent-4. <user-manager <property <property <property <property <property <property class="com.0.ear]. Download and install Orion [http://www.com/j2se/1. found in liferay-portal-ent-4. OracleAS has a bug that will not allow the servlet init method to call secured EJBs unless that init method is called during startup.2 [http://java. • Open your browser to http://localhost:8080.. Edit orion-application.com-web-access.DataSourceUserManager"> name="dataSource" value="jdbc/LiferayPool" /> name="table" value="User_" /> name="usernameField" value="userId" /> name="passwordField" value="password_" /> name="defaultGroups" value="users" /> name="staleness" value="0" /> 17 .OutOfMemoryError exception while starting up OracleAS. Click on My Liferay at the upper right hand corner to enter the login screen. Edit orion-application.sourceforge.transport.log" /> </web-site> Make sure to set load-on-startup to true.0./log/liferay.Installation and Setup <web-site port="8080"> <default-web-app application="liferay" name="portal-web-complete" load-on-startup="true" /> <web-app application="liferay" name="tunnel-web" root="/tunnel" load-on-startup="true" /> <access-log path=".host" value="localhost" /> </mail-session> • Configure JAAS. You only need to set the locations of the IMAP.0.evermind.0.protocol" value="smtp" /> <property name="mail. <mail-session location="mail/MailSession" smtp-host="localhost"> <property name="mail.. Configure data sources for your database. Your login is test@liferay. Download liferay-portal-ent-4.ear [http://prdownloads.0.orionserver. • Start OracleAS.0.sun. POP3.ear and configure a mail session.lang.xml.imap.6 • • • • • • Download and install JDK 1.0.0.

OutOfMemoryError exception while starting up Orion. Edit /server/bin/setup.0.com/j2se/1.0.0.0. Download liferay-portal-ent-4.0.com-web-access.ear.ear]. Copy liferay-portal-ent-4./web-sites/liferay.com-web.sourceforge.Installation and Setup </user-manager> • Deploy liferay-portal-ent-4. • Start Orion.0.2 [http://java./log/liferay.com and your password is test. give your JVM more memory by setting -Xmx512m. <web-site path=". Click on My Liferay at the upper right hand corner to enter the login screen.xml.ear" /> Edit /config/server.../.log" /> </web-site> Make sure to set load-on-startup to true.0. set LOCALCLASSPATH= for %%i in ("lib\*.com/]. Your login is test@liferay.bat.ear [http://prdownloads.0. This script will load everything in /server/lib/ext into the class path.bat" %%i 18 .0.sun.0.. <web-site port="8080"> <default-web-app application="liferay" name="portal-web-complete" load-on-startup="true" /> <web-app application="liferay" name="tunnel-web" root="/tunnel" load-on-startup="true" /> <access-log path=".xml to tell Orion where to find liferay-portal-ent-4. Download lcp. Populate your database with the portal schema and default data. Edit /config/server.0.ear to /applications.net/lportal/liferay-portal-ent-4. • Open your browser to http://localhost:8080.4.bat.2] . Add the following snippet right after Pramati declares the CLASSPATH./applications/liferay-portal-ent-4.jar") do call "lcp.xml and add a new web site entry.lang. Pramati 4.4.0.com-web. <application name="liferay" path=". Set an environment variable called %JAVA_HOME% to point to your JDK directory.pramati. Download and install Pramati [http://www. If you get a java.xml" /> Create /config/web-sites/liferay.ear.1 • • • • • Download and install JDK 1.

the batch file to start the server will end with the extension sh instead of bat.0. Resin 3.0-resin.lang.Installation and Setup set CLASSPATH=%CLASSPATH%.0.com/j2se/1. If you get a java.2 [http://java.4. You must start the executable from the directory where it resides.com and your password is test.sourceforge.0-resin.0. Make sure to chmod the batch file so you can execute it.14 Easy • • • • Download and install JDK 1. Your login is test@liferay.0.2] . Click on My Liferay at the upper right hand corner to enter the login screen.2 [http://java.ear. Your login is test@liferay. • • • Configure data sources for your database. Expert • Download and install JDK 1.2] .net/lportal/liferay-portal-pro-4.sun.0. Set an environment variable called %JAVA_HOME% to point to your JDK directory. You only need to set the locations of the IMAP.com and your password is test.4. We recommend that you use the Deploy Tool instead of the Admin Console because the Deploy Tool is a lot more stable for large EARs.pdf] from Pramati for more information. • Open your browser to http://localhost:8080.OutOfMemoryError exception while starting up Pramati. Be sure to unzip with folder names.zip [http://prdownloads. Create a mail session bound to mail/MailSession.%LOCALCLASSPATH% • Start Pramati. When in a Unix environment.4.com/docstore/1290023/liferay.sun. Click on My Liferay at the upper right hand corner to enter the login screen. Deploy liferay-portal-ent-4.zip to C:\LIFERAY (or any another directory). Set an environment variable called %JAVA_HOME% to point to your JDK directory. POP3.0-resin.pramati. Unzip liferay-portal-pro-4.0. give your JVM more memory by setting -Xmx512m. and SMTP servers.bat to run the database and web server. Download liferay-portal-pro-4. Make sure the JDBC driver for your database is accessible by Pramati. Follow the instructions [http://www. Make sure that there isn't another application already using port 8080. 19 . Execute C:\LIFERAY\bin\run. • Open your browser to http://localhost:8080.com/j2se/1.4.zip].

parsers.host> <mail. Open up liferay-portal-ent-4.0.0-src.xalan.zip].transport. Edit /conf/resin.war. Create a mail session bound to mail/MailSession.DocumentBuilderFactoryImpl" /> <system-property javax.jar.net/lportal/liferay-portal-pro-4.0.store.net/lportal/liferay-portal-ent-4. /portal/lib/xalan.0.0.SAXParserFactoryImpl" /> <system-property javax.sourceforge.rootDir}/common/classes"/> <library-loader path="${server.transform.driver="org.host>localhost</mail.parsers.conf and configure a mail session.rootDir}/common/lib"/> • • Configure data sources for your database.jar/.protocol>imap</mail. Populate your database with the portal schema and default data.protocol>smtp</mail.zip and copy /portal/lib/saxpath.jar from %CATALINA_HOME%/liferay/WEB-INF/lib to /common/lib/ext. You only need to set the locations of the IMAP. Make sure the JDBC driver for your database is accessible by Resin. • • • Download liferay-portal-pro-4.xerces.war]. <compiling-loader path="${server. Edit /conf/resin.host>localhost</mail.pop3.xml. Unpack liferay-portal-pro-4.apache.sax.0.pop3.jaxp.xerces.0. 20 .0.xerces. <system-property javax.mail.protocol> <mail.0-src.store.0.0.smtp.host>localhost</mail. and / portal/lib/xercesImpl. Move every jar except util-taglib.caucho.imap.war to %CATALINA_HOME%/liferay. POP3.transport.Installation and Setup • • Download and install Resin [http://www. This step is only necessary if you plan to hot deploy portlet WARs.0.jaxp.parsers.conf.xml.conf to set up the correct SAX parsers. and SMTP servers.apache.TransformerFactoryImpl" /> <system-property org.xml.TransformerFactory= "org.0-src.com/].host> <mail.sourceforge.smtp.Session"> <init> <mail.war [http://prdownloads.jar to /lib so that Resin has the proper libraries for SAX parsing.zip [http://prdownloads.protocol> <mail.host> </init> </resource> • Deploy liferay-portal-pro-4. Edit /conf/resin.0.imap.SAXParser" /> Download liferay-portal-ent-4.apache.apache.xml.SAXParserFactory="org.DocumentBuilderFactory= "org.processor. <resource jndi-name="mail/MailSession" type="javax.

Edit server.net/lportal/liferay-portal-ent-4.com and your password is test. <mail jndi-name="mail/MailSession" name="mail"> <properties name="mail.0.xml and configure a security realm.MF.ear [http://prdownloads.com/j2se/1.host" value="localhost"></properties> </mail> • Configure JAAS. • Open your browser to http://localhost:8080.ear].0. Edit /server.tradecity. Make sure the JDBC driver for your database is accessible by RexIP.sourceforge.xml and configure a mail session.4.4.lang. Configure data sources for your database.OutOfMemoryError exception while starting up Resin.sun.0. Click on My Liferay at the upper right hand corner to enter the login screen.ear.0. Copy the dependent libraries to /lib.0. POP3. The dependent libraries are found in a /lib inside liferay-portal-ent-4. Edit /server.0.2 [http://java. and SMTP servers. Your login is test@liferay. Set an environment variable called %JAVA_HOME% to point to your JDK directory.5 • • • • • • • Download and install JDK 1. Populate your database with the portal schema and default data. RexIP 2. <security default-basic-realm="PortalRealm"> <basic-realm check-login-query="SELECT * FROM User_ WHERE userId = ? AND password_ = ?" datasource-name="LiferayPool" get-user-query="" get-group-query="" name="PortalRealm" realm-type="jdbc" user-role-query=""> </basic-realm> </security> • Deploy liferay-portal-ent-4. 21 .ear. Download liferay-portal-ent-4. Download and install RexIP [http://www.0.2] . ReXIP has a bug which prevents it from picking up the dependent libraries declared in MANIFEST. give your JVM more memory by setting -Xmx512m.xml to tell RexIP where to find the unarchived application.com/]. You only need to set the locations of the IMAP. If you get a java.smtp. Create a mail session bound to mail/MailSession.Installation and Setup • Start Resin.0.

sun.AuthPermission "getLoginConfiguration". and 22 .*".xml/].security. Create a mail session bound to mail/MailSession.util. Edit /AppServer/domains/domain1/server1/config/server. "read.PropertyPermission "*".FilePermission "<>". Your login is test@liferay. to permission java.sourceforge.write".ear [http://prdownloads. • Open your browser to http://localhost:8080. You only need to set the locations of the IMAP.lang.lang.ReflectPermission "suppressAccessChecks".2 [http://java.0. • Start Sun JSAS.com/software/products/appsrvr/home_appsrvr. Refer to Sun's documentation [http://java.net/lportal/liferay-portal-ent-4.sun.util.AuthPermission "setLoginConfiguration". Change permission java.0.policy.html] for more information. Download and install Sun JSAS [http://www.lang. give your JVM more memory by setting -Xmx512m. Sun JSAS 8.write". Add permission java.reflect.OutOfMemoryError exception while starting up Sun JSAS.execute.RuntimePermission "*".4.PropertyPermission "*".auth.FilePermission "<>". Add permission java.2] . to permission java. If you get a java. If you get a java. POP3.Installation and Setup <app name="liferayApp" path="liferay/"> <server name="liferayServer"></server> </app> • Start RexIP.io. "read".com/j2se/1. Click on My Liferay at the upper right hand corner to enter the login screen. "read. Make sure the JDBC driver for your database is accessible by Sun JSAS. "read.01 • • • • • Download and install JDK 1.2/docs/guide/security/permissions.delete".io. Download liferay-portal-ent-4.write.auth. Populate your database with the portal schema and default data.SecurityPermission "insertProvider.4.security.com and your password is test.ear].OutOfMemoryError exception while starting up RexIP.0. Add permission javax.sun. Add permission java. Change permission java. Configure data sources for your database.com/j2se/1. give your JVM more memory by setting -Xmx512m. Set an environment variable called %JAVA_HOME% to point to your JDK directory.4.security.0. Add permission javax.lang.

ext. Be sure to unzip with folder names.2] .PortalLoginModule required. add /AppServer/lib/liferay-portal-ent-4.zip [http://prdownloads.sourceforge.x/5. Restart Sun JSAS because there is a conflict with the default web application that is also listening on /. Add the property jaas-context with the value PortalRealm.sun.portal.ext. When in a Unix environment.security.0. • Deploy liferay-portal-ent-4.jaas.com/j2se/1.2 [http://java. Edit the server instance's JVM Settings. Edit /AppServer/domains/domain1/server1/config/login. • Open your browser to http://localhost:8080. Make sure that there isn't another application already using port 8080.portal. • Open your browser to http://localhost:8080.liferay. Tomcat 5.0. Download liferay-portal-ent-4.ear. Set an environment variable called %JAVA_HOME% to point to your JDK directory. PortalRealm { com.0-jaas.sun7.0-tomcat.0.liferay.liferay.Installation and Setup SMTP servers.com and your password is test.ext.security.PortalLoginModule if you are using the older Sun ONE 7.sun8. Click on My Liferay at the upper right hand corner to enter the lo23 .0.jaas.0.0-jaas. Download liferay-portal-pro-4.liferay. the batch file to start the server will end with the extension sh instead of bat. Restart Sun JSAS.5.jaas. Use the class name com. Click on My Liferay at the upper right hand corner to enter the login screen.sun7.ext.4.security.x Easy • • • • Download and install JDK 1. Edit properties for PortalRealm.0-tomcat.0. You must start the executable from the directory where it resides.0. Execute C:\LIFERAY\bin\startup. Your login is test@liferay.conf. Make sure to chmod the batch file so you can execute it. Use com. Create a new security realm called PortalRealm with class name com.security.PortalRealm.4.jaas. }.sun8.jar to the classpath suffix. Under path settings.portal.zip].net/lportal/liferay-portal-pro-4.portal.PortalRealm if you are using the older Sun ONE 7.bat to run the database and web server.jar.0-tomcat. Unzip liferay-portal-pro-4.0. Configure JAAS.zip to C:\LIFERAY (or any another directory).

0. <Context..war].x.x but will also give special instructions for usage with Tomcat 5. Create a mail session bound to mail/MailSession.org/tomcat/].xml. <Context path="" docBase=".0.properties. You only need to set the locations of the IMAP. POP3. For Tomcat 5. If you are using Tomcat 5.0.> <Resource name="mail/MailSession" auth="Container" type="javax. • Create /conf/Catalina/localhost/liferay.mail.war [http://prdownloads. edit /conf/Catalina/localhost/ROOT.sun.x or Tomcat 5.5.5.apache.4. Populate your database with the portal schema and default data.Installation and Setup gin screen.sourceforge. Expert • Download and install JDK 1.0. Make sure the JDBC driver for your database is accessible by Tomcat.2] .net/lportal/liferay-portal-pro-4. • Download and install Tomcat [http://jakarta.x.com/j2se/1..x.5.xml to set up the portal web application. you must download and install JDK 5.xml.Session" /> <ResourceParams name="mail/MailSession"> <parameter> 24 . Set an environment variable called %JAVA_HOME% to point to your JDK directory. Your login is test@liferay. Edit /conf/Catalina/localhost/liferay..loader= ${catalina.x.2 [http://java. Edit /conf/catalina.home}/common/classes. common.com and your password is test./liferay" debug="0" reloadable="true" crossContext="true"> </Context> For Tomcat 5.\ .xml and configure a mail session. You can download Tomcat 5..0. and SMTP servers. edit / conf/Catalina/localhost/ROOT.x.jar • • Configure data sources for your database.5. • • • Download liferay-portal-pro-4..\ ${catalina.4. This documentation assumes that you are using Tomcat 5.home}/common/lib/ext/*.0.5. You must also remove the reference to path="" in the XML.

store.}.jaas.xml if you want to enable Liferay's HTTP tunneling..jaas.transport.PortalPrincipal" roleClassNames="com..security.apache.liferay. <Context.protocol</name> <value>smtp</value> </parameter> <parameter> <name>mail.jaas.host</name> <value>localhost</value> </parameter> <parameter> <name>mail. 25 .imap..host</name> <value>localhost</value> </parameter> <parameter> <name>mail.war. For Tomcat 5.x.JAASRealm" appName="PortalRealm" userClassNames="com.5. rem ----.0.smtp.liferay.portal.> <Realm className="org.config=%CATALINA_HOME%/conf/jaas. Edit /conf/Catalina/localhost/liferay.. edit / conf/Catalina/localhost/ROOT. PortalRealm { com.portal.PortalRole" debug="99" useContextClassLoader="false" /> </Context> Repeat this step for a file called /conf/Catalina/localhost/tunnel.config • Deploy liferay-portal-pro-4.Execute. Edit /bin/catalina.pop3.host</name> <value>localhost</value> </parameter> </ResourceParams> </Context> • Configure JAAS.PortalLoginModule required.realm. .Installation and Setup <name>mail.bat so that Tomcat can reference the login module.auth..liferay.login.security.xml and configure a security realm.security.xml.0..portal.config. Create /conf/jaas. set JAVA_OPTS=%JAVA_OPTS% -Djava.protocol</name> <value>imap</value> </parameter> <parameter> <name>mail.security.catalina.

give your JVM more memory by setting -Xmx512m. • Start WebLogic. Open your browser to http://localhost:8080.net/lportal/liferay-portal-ent-4.com/j2se/1. • Start Tomcat.com/document/lcp.liferay. follow the additional instructions from this post [http://forums.0. Populate your database with the portal schema and default data.com/index.OutOfMemoryError exception while starting up WebLogic. 26 . Add the following snippet right after WebLogic declares the CLASSPATH. Make sure the JDBC driver for your database is accessible by WebLogic.cmd.OutOfMemoryError exception while starting up Tomcat.ear.1 SP3. This script will load everything in /user_projects/domains/mydomain/lib into the class path. You only need to set the locations of the IMAP.php?showtopic=763&hl=].2 [http://java.0.com and your password is test. Edit /user_projects/domains/mydomain/startWebLogic. set LOCALCLASSPATH= for %%i in ("lib\*.0.%LOCALCLASSPATH% set MEM_ARGS=-Xmx512m For WebLogic 8. WebLogic 8.liferay.0. Download lcp. This step is only necessary if you plan to hot deploy portlet WARs. • Open your browser to http://localhost:8080.com/]. Set an environment variable called %JAVA_HOME% to point to your JDK directory.4.beasys.4.0.lang. Click on My Liferay at the upper right hand corner to enter the login screen. give your JVM more memory by setting -Xmx512m.bat].jar from %CATALINA_HOME%/liferay/WEB-INF/lib to /common/lib/ext. Move every jar except util-taglib. Your login is test@liferay. Create a mail session bound to mail/MailSession.jar") do call "lcp.ear [http://prdownloads.bat" %%i set CLASSPATH=%CLASSPATH%. Download and install WebLogic [http://www. and SMTP servers.sun.Installation and Setup Unpack liferay-portal-pro-4.sourceforge.lang.bat [http://content. Download liferay-portal-ent-4.0. Click on My Liferay at the upper right hand corner to enter the login screen. If you get a java. • • • • Configure data sources for your database.ear].1 SP4 • • • • • Download and install JDK 1.0. Your login is test@liferay. Deploy liferay-portal-ent-4.0.2] . POP3. If you get a java.com and your password is test.war to %CATALINA_HOME%/liferay.

select “User-Defined JDBC Provider” Under General Properties.e. c:\Liferay\lib”). “LibrayLibs”). or liferay-jdbc-4. select “Parent Last” under “Class Loader mode”. Click Next.jar System-ext.5 Define Environment • Copy the following under <WAS_HOME>/lib/ext directory.e. Click “New”. Enter in the Name field “Liferay JDBC Provider” (or some other descriptive name) Remove any text from the “Class Path” field. Click “New” under “Preferences”. Restart Websphere. select this classloader. Under “ClassPath”. • Define Data Connection • • • • • • • Login to the Websphere Admin Console Under Resources.0. Click “OK” and “Save” at the top of the page to save your changes. under Environment.properties Your custom authentication class or the Liferay provided custom authentication class (provided in com. select “Class Loader” under “Java and Process Management”.ext. Login to the Websphere Admin Console. and under “Library Name”. Enter a Name (i.liferay.jar Commons-pool. under “Additional Properties”. “server1”). you should see the new class loader as “Classloader_12345678”. • • • • • • • • • • • • • Commons-dbcp. Under General Properties. c:\Liferay\lib).portal.e. select “User-defined”. Shared Libraries.e. select “User-Defined” Under General Properties.Installation and Setup WebSphere 6. Click New.jaas. enter the directory created in Step 2 above (i.0. select the application server you’re using (i. Step 2.e.security. you should select the classloader created above (i. Step 1. Click OK. Under the Class Loader section.websphere. Be sure “Node” is selected under “Scope”. select Apply.2. ensure “Node” is selected under “Scope”. Under “Server Infrastructure”.0rc2). The JDBC driver used by your custom authentication class.class in liferay-portal-jaas-4.jar from the liferay-portal-4x. select JDBC Providers. Unzip all the libraries except util-tag.jar.war into a new directory (i.properties portal-ext. Under “Servers”.x. click “OK”. select “Add”. “LiferayLibs”) and Description. if the custom authentication uses the Liferay driver. Step 3. and then “Save” at the top of the page to save your changes before continuing. “Application Servers”.PortalUserRegistry. Click “OK” and “Save” at the top of the page. 27 .

class in liferayportal-jaas-4. etc). select the JDBC Provider you just created.websphere.0rc2) In the WebSphere Admin Console.ext. click “Data Sources”. Test the connection by selecting under Resources. “JDBC Providers”. • • • • • • • Install Liferay • • • Login to the Websphere Admin Console Ensure the “Default Application” is either removed or not running under “Enterprise Applications”. You may also enter values in the “Server User Id” and “Server User Password” field if you want to use these values when you login to the Admin Console. you will see them here when you attempt to save.PortalUserRegistry” in the “Custom User Registry Class Name” field.PortalUserRegistry. The remaining values (“Authentication Alias”.jaas. Setup Security • Create your custom login class by creating your own class or using the provided Liferay login class for Websphere (provided in com.Installation and Setup • • After saving. per your database of choice: • • • • url password user password • • • • Save changes. and then click “Test Connection”.liferay. Enter the custom login class you created or “com.portal.0. click “Custom” under “User Registries”.jaas. Under “Data store helper class name”.ext. 28 . click “Custom Properties” and add the following. and click “New” Under General Properties.liferay. Click OK. Restart WebSphere and login using the name provided in Step 29 above or using the appropriate database id/ password as coded in your custom login class.portal. Under “Global Security”. Select the “Data Source” you just created (“Liferay”).security. Under “Configuration”. leave the default “Generic data store helper” selected. de-select “Enforce Java 2 Security”. and “Container-managed Authentication” are not used and should default to “none”) Click “OK” and then “Save” at the top of the page to save your changes before continuing.websphere. and then “Save” at the top of the page to save your changes before continuing. Click “Install New Application”. “Liferay JDBC Providers” (or whatever you named in step 9 above). select “Custom user registry”. select “Enable global security”. select “Global Security” under the “Security” section. and under “Active user registry”. If you encounter any errors (class not found.security. enter “Liferay” in the “Name” field and “jdbc/LiferayPool” in the “JNDI name” field.

Installation and Setup

• • • • • • • •

Select the desired Liferay WAR file (i.e. liferay-portal-4x.war) using Local or Remote file system. Enter “/” as the Context root, click “Next”. Do not change any values on the next page, click “Next”. The next page will show “Application Security Warnings”, click “Continue”. Enter a valid “Directory to install the application” (i.e. c:\Apps\Liferay”). Under “Application Name”, shorten the name to “Liferay4”, or something similar. Leave all other fields to their default values. Click “Next”. Under “Map Modules to Servers”, select the Cells/Webserver targets for your environment, normally you would select all the items in “Clusters and Servers”, click the checkbox under “Select”, then click “Apply”. Enter “mail/MailSession” in the “JNDI Name” under “javax.mail.session” section. Under the page “Map Resource Reference to Resources”, under “javax.sql.DataSource”, select the checkbox at the bottom of the page under “Select”. Then, under “Specify existing Resource JNDI name”, select “jdbc/LiferayPool”, click the “Apply” button next to this drop-down. Select “Next” at the bottom of the page. Under “Application Resource Warnings”, click “Continue”. Under “Map virtual hosts for Web Modules”, click “Next”. Under “Map security roles to users/groups”, across from “users” select the checkbox under “All authenticated”. Under the “Summary”, click “Finish”. If the application install completed without any errors, click “Save to Master Configuration”. Under “Applications”, select the LiferayEAR, under “Class Loading and File Update Detection, change “Class loader mode” to “Parent Last” Under “Applications”, select the LiferayEAR application by selecting the check box, then select “Start”.

• • • • • • • •

WebSphere 5.1
• • • • • Download and install JDK 1.4.2 [http://java.sun.com/j2se/1.4.2] . Set an environment variable called %JAVA_HOME% to point to your JDK directory. Download and install WebSphere [http://www.ibm.com/]. Download liferay-portal-pro-4.0.0.war [http://prdownloads.sourceforge.net/lportal/liferay-portal-pro-4.0.0.war]. Populate your database with the portal schema and default data. WebSphere does not have access to com.sun.crypto.provider.SunJCE and requires com.ibm.crypto.provider.IBMJCE for the programmatic encryption calls made by the portal. Create system-ext.properties in /AppServer/lib/ext and set com.liferay.util.Encryptor.provider.class with the value com.ibm.crypto.provider.IBMJCE. This step is not required because Liferay is smart enough to use IBMJCE instead of SunJCE when in WebSphere, but will issue a warning in the log files. 29

Installation and Setup

Start WebSphere. If you get a java.lang.OutOfMemoryError exception while starting up WebSphere, give your JVM more memory by setting -Xmx512m.

• •

Configure data sources for your database. Make sure the JDBC driver for your database is accessible by WebSphere. Configure JAAS. Download liferay-portal-ent-4.0.0-jaas.jar into /AppServer/lib/ext. Use the Administrative Console to add a custom user registry: Security -> User Registries -> Custom. Set system as the server user id, password as the server user password, and com.liferay.portal.security.jaas.ext.websphere.PortalUserRegistry as the custom registry class name. WebSphere is now configured to check security from the jdbc/LiferayPool which points to the Liferay tables. Add a corresponding user to the User_ table. insert into User_ (companyId, userId, password_) values ('system', 'system', 'password'); Edit your Stop the Server shortcut to set the user id and password. If you don't do this, you will not be able to stop the server after your restart WebSphere. "C:\Program Files\WebSphere\AppServer\bin\stopServer.bat" server1 -user system -password password Go to Security -> Global Security. Check Enabled. Uncheck Enforce Java 2 Security. Set the Active User Registry to Custom. Restart WebSphere.

Deploy liferay-portal-pro-4.0.0.war. Open up liferay-portal-pro-4.0.0.war and move every jar except util-taglib.jar from liferay-portal-pro-4.0.0.war to /Anywhere/lib. Use the Administrative Console: Applications -> Enterprise Applications -> adminconsole and set the Classloader Mode to PARENT_LAST. Go to Environment -> Shared Libraries and create a new library with the name Liferay Libraries and a classpath that points to /Anywhere/lib. Go to Servers -> Application Servers -> server1 -> Classloader and create a new classloader with the Libraries set at Liferay Libraries and the Classloader Mode set at PARENT_FIRST. Go to Applications -> Enterprise Applications to stop and uninstall the default application because it is also listening on /. Go to Applications -> Install New Application. Upload liferay-portal-pro-4.0.0.war and set the context root to /. Click Next. Check Generate Default Bindings, then click Next. Click Continue. 30

Installation and Setup

Click Next for Step 1. Set mail/MailSession as the mail session and jdbc/LiferayPool as the data source, then click Next for Step 2. Click Next for Step 3. Click Next for Step 4. Check All Authenticated?, then click Next for Step 5. Click Finish for Step 6. Restart WebSphere. • Open your browser to http://localhost:8080. Click on My Liferay at the upper right hand corner to enter the login screen. Your login is test@liferay.com and your password is test.

Databases
Liferay Portal Enterprise was designed to be database agnostic. To make this possible, all business logic had to be concentrated in the middle tier with the database being as dumb as possible. This means the portal does not rely on any database specific stored procedures or on the database to generate unique keys. To generate scripts that create and populate the database, go to /portal-ejb and run the ant command: ant build-db. This command will generate the scripts for DB2, Firebird, Hypersonic, Interbase, JDataStore, MySQL, Oracle, PostgreSQL, and SQL Server. The generated scripts reside in /sql/portal and are named: portal-db2.sql, portal-firebird.sql, portal-hypersonic.sql, portal-interbase.sql, portal-jdatastore.sql, portal-mysql.sql, portal-oracle.sql, portal-postgresql.sql, and portalsql-server.sql.

DB2
Create a database in DB2 called lportal. Use Command Center to load the script named portal-db2.sql.

BES with DB2
Create a data source bound to jdbc/LiferayPool by editing jndi-definitions and creating liferay.dar. DAR files are custom to BES. You can use the BES Deployment Descriptor Editor to create the DAR file. <jndi-definitions> <visitransact-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <driver-datasource-jndiname>datasources/JdsLiferayDriver</driver-datasource-jndiname> <property> <prop-name>connectionType</prop-name> <prop-type>Enumerated</prop-type> <prop-value>Direct</prop-value> </property> <property> <prop-name>dialect</prop-name> <prop-type>Enumerated</prop-type> <prop-value>db2</prop-value> </property> </visitransact-datasource> 31

mortbay.commons. <Call name="addService"> <Arg> <New class="org. undeploy it by removing its xml configuration.LiferayDriver</prop-value> </property> <property> <prop-name>url</prop-name> <prop-type>String</prop-type> <prop-value>jdbc:db2://localhost:50000/lportal</prop-value> </property> <property> <prop-name>username</prop-name> <prop-type>String</prop-type> <prop-value>test</prop-value> </property> <property> <prop-name>password</prop-name> <prop-type>String</prop-type> <prop-value>test</prop-value> </property> </driver-datasource> </jndi-definitions> Copy the JDBC driver to a path that can be picked up by BES. Jetty with DB2 Create a data source bound to jdbc/LiferayPool by editing /etc/jetty.Installation and Setup <driver-datasource> <jndi-name>datasources/JdsLiferayDriver</jndi-name> <datasource-class-name>org. JDBC drivers can be found from the database vendor's web site.JotmService"> <Set name="Name">TransactionMgr</Set> <Call name="addDataSource"> 32 .DriverAdapterCPDS</datasource-cl <log-writer>False</log-writer> <property> <prop-name>driver</prop-name> <prop-type>String</prop-type> <prop-value>com.jetty. If there is a duplicate service.jdbc.liferay.jdbc. JDBC drivers can be found from the database vendor's web site. JBoss with DB2 Create a data source bound to jdbc/LiferayPool by editing liferay-ds.liferay.cpdsadapter.dbcp.plus. <datasources> <local-tx-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <connection-url> jdbc:db2://localhost:50000/lportal </connection-url> <driver-class>com.xml. Make sure there isn't another data source bound to jdbc/LiferayPool.LiferayDriver</driver-class> <user-name>test</user-name> <password>test</password> <min-pool-size>0</min-pool-size> </local-tx-datasource> </datasources> Copy the JDBC driver for to /server/default/lib.apache.xml.

jdbc.liferay.standard.StandardXAPoolDataSource"> <Arg type="Integer">4</Arg> <Set name="MinSize">4</Set> <Set name="MaxSize">15</Set> </New> </Arg> </Call> </New> </Arg> </Call> Copy the JDBC driver for to /lib. com.jdbc. JOnAS with DB2 Create a data source bound to jdbc/LiferayPool by editing /conf/jonas/liferay-ds.Installation and Setup <Arg>jdbc/LiferayPool</Arg> <Arg> <New class="org.LiferayDriver</Set> <Set name="Url">jdbc:db2://localhost:50000/lportal</Set> <Set name="User">test</Set> <Set name="Password">test</Set> </New> </Arg> <Arg> <New class="org.liferay.xml. JRun with DB2 Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:db2://localhost:50000/lportal as the URL.sql.jdbc. datasource.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" 33 . OracleAS with DB2 Create a data source bound to jdbc/LiferayPool.properties.jdbc.enhydra.evermind.liferay. JDBC drivers can be found from the database vendor's web site.classname=com. create a Tx data source bound to jdbc/LiferayEJB. test as the user name.name=jdbc/LiferayPool datasource. <data-source class="com.StandardXADataSource"> <Set name="DriverName">com.pool.password=test datasource. JDBC drivers can be found from the database vendor's web site.jdbc. and test as the password.enhydra.LiferayDriver as the driver.url=jdbc:db2://localhost:50000/lportal datasource. and set the proper JDBC properties by editing /config/data-sources.LiferayDriver datasource.username=test datasource.mapper= Copy the JDBC driver for to /lib/ext.

Orion with DB2 Create a data source bound to jdbc/LiferayPool. and test as the password. Pramati with DB2 Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:db2://localhost:50000/lportal as the URL. If there is a duplicate service.liferay.sql.liferay.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="com. undeploy it by removing its xml configuration.LiferayDriver" url="jdbc:db2://localhost:50000/lportal" username="test" password="test" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver to /j2ee/home/lib. create a Tx data source bound to jdbc/LiferayEJB. Resin with DB2 Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /conf/resin. Make sure there isn't another data source bound to jdbc/LiferayPool. undeploy it by removing its xml configuration.liferay.LiferayDriver as the driver.jdbc.evermind.LiferayDriver"> <url>jdbc:db2://localhost:50000/lportal</url> <user>test</user> <password>test</password> </driver> <prepared-statement-cache-size>8</prepared-statement-cache-size> <max-connections>20</max-connections> 34 . If there is a duplicate service.liferay.jdbc. test as the user name. com.Installation and Setup connection-driver="com.xml.jdbc. <database> <jndi-name>jdbc/LiferayPool</jndi-name> <driver type="com. JDBC drivers can be found from the database vendor's web site. Make sure there isn't another data source bound to jdbc/LiferayPool. JDBC drivers can be found from the database vendor's web site.LiferayDriver" url="jdbc:db2://localhost:50000/lportal" username="test" password="test" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver for to /lib.conf.jdbc. and set the proper JDBC properties by editing /config/data-sources. <data-source class="com.

username=test.LiferayDriver.commons. Make sure there isn't another data source bound to jdbc/LiferayPool.liferay. Tomcat with DB2 For Tomcat 5.apache.LiferayDriver" url="jdbc:db2://localhost:50000/lportal" username="test" password="test" max-pool="100" transactional="false" /> Copy the JDBC driver to /lib. <datasource name="LiferayPool" jndi-name="jdbc/LiferayPool" driver="com.xml.xml. undeploy it by removing its xml configuration. Make sure there isn't another data source bound to jdbc/LiferayPool. If there is a duplicate service.jdbc..BasicDataSource as the data source class. <Resource name="jdbc/LiferayPool" auth="Container" type="javax.x. JDBC drivers can be found from the database vendor's web site. Create a data source bound to jdbc/LiferayPool.dbcp.LiferayDriver</value> </parameter> <parameter> <name>url</name> <value>jdbc:db2://localhost:50000/lportal</value> </parameter> 35 .jdbc.liferay. <Context. The pool properties are driverClassName=com. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/liferay.liferay.0.> .Installation and Setup <max-idle-time>30s</max-idle-time> </database> Copy the JDBC driver to /lib. url=jdbc:db2://localhost:50000/lportal. JDBC drivers can be found from the database vendor's web site.. undeploy it by removing its xml configuration. Sun JSAS with DB2 Use the Administration Console to do the following: Create a connection pool org. and password=test.jdbc. RexIP with DB2 Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /server.DataSource" /> <ResourceParams name="jdbc/LiferayPool"> <parameter> <name>driverClassName</name> <value>com... If there is a duplicate service.sql.

Installation and Setup <parameter> <name>username</name> <value>test</value> </parameter> <parameter> <name>password</name> <value>test</value> </parameter> <parameter> <name>maxActive</name> <value>20</value> </parameter> </ResourceParams> </Context> For Tomcat 5.jar.LiferayDriver" url="jdbc:db2://localhost:50000/lportal" username="test" password="test" maxActive="100" maxIdle="30" maxWait="10000" /> </Context> For Tomcat 5.liferay. JDBC drivers can be found from the database vendor's web site. Copy commons-dbcp.xml.LiferayDriver.jdbc. Create a Tx data source bound to jdbc/LiferayEJB.jdbc. 36 . test as the user name. user=test. and your JDBC driver to /AppServer/lib/ext.LiferayDriver as the driver. Set org.DataSource" driverClassName="com. and password=test.5.dbcp. url=jdbc:db2://localhost:50000/lportal.sql. Create a data source bound to jdbc/LiferayPool.liferay. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/ROOT. com.x. <Context.5.x.jdbc.x and 5. The custom properties are driver=com. copy the JDBC driver to /common/lib. Create a data source bound to jdbc/LiferayPool.DriverAdapterCPDS as the implementation class name. WebSphere with DB2 Use the Administrative Console: Resources -> JDBC Providers.liferay.apache.> <Resource name="jdbc/LiferayPool" auth="Container" type="javax. commons-pool. Create a new user-defined JDBC provider.0. WebLogic with DB2 Use the Administration Console to do the following: Create a connection pool using jdbc:db2://localhost:50000/lportal as the URL.commons. and test as the password..jar.cpdsadapter.. Remove any references in the class path.

dar. <datasources> <local-tx-datasource> 37 . DAR files are custom to BES.sql. type isql -U sysdba -P masterkey -d /opt/data/lportal.DriverAdapterCPDS</datasource-cl <log-writer>False</log-writer> <property> <prop-name>driver</prop-name> <prop-type>String</prop-type> <prop-value>org.Installation and Setup Firebird Create a database in InterBase located at /opt/data/lportal. JBoss with Firebird Create a data source bound to jdbc/LiferayPool by editing liferay-ds.apache.dbcp.jdbc. You can use the BES Deployment Descriptor Editor to create the DAR file.gdb -i portal-interbase. At your UNIX shell or DOS prompt.firebirdsql. JDBC drivers can be found from the database vendor's web site.xml.commons. <jndi-definitions> <visitransact-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <driver-datasource-jndiname>datasources/JdsLiferayDriver</driver-datasource-jndiname> <property> <prop-name>connectionType</prop-name> <prop-type>Enumerated</prop-type> <prop-value>Direct</prop-value> </property> <property> <prop-name>dialect</prop-name> <prop-type>Enumerated</prop-type> <prop-value>firebird</prop-value> </property> </visitransact-datasource> <driver-datasource> <jndi-name>datasources/JdsLiferayDriver</jndi-name> <datasource-class-name>org.gdb</prop-value> </property> <property> <prop-name>username</prop-name> <prop-type>String</prop-type> <prop-value>sysdba</prop-value> </property> <property> <prop-name>password</prop-name> <prop-type>String</prop-type> <prop-value>masterkey</prop-value> </property> </driver-datasource> </jndi-definitions> Copy the JDBC driver to a path that can be picked up by BES. BES with Firebird Create a data source bound to jdbc/LiferayPool by editing jndi-definitions and creating liferay.cpdsadapter.gdb.FBDriver</prop-value> </property> <property> <prop-name>url</prop-name> <prop-type>String</prop-type> <prop-value>jdbc:firebirdsql://localhost/opt/data/lportal.

enhydra.StandardXADataSource"> <Set name="DriverName">org. datasource.jdbc. If there is a duplicate service.firebirdsql. <Call name="addService"> <Arg> <New class="org.jdbc.jetty.jdbc.jdbc.xml.username=sysdba 38 .mortbay.name=jdbc/LiferayPool datasource.pool.gdb</Set> <Set name="User">sysdba</Set> <Set name="Password">masterkey</Set> </New> </Arg> <Arg> <New class="org.jdbc. JDBC drivers can be found from the database vendor's web site.properties. JOnAS with Firebird Create a data source bound to jdbc/LiferayPool by editing /conf/jonas/liferay-ds. Make sure there isn't another data source bound to jdbc/LiferayPool.FBDriver datasource. undeploy it by removing its xml configuration.firebirdsql.gdb datasource.enhydra.firebirdsql.JotmService"> <Set name="Name">TransactionMgr</Set> <Call name="addDataSource"> <Arg>jdbc/LiferayPool</Arg> <Arg> <New class="org. Jetty with Firebird Create a data source bound to jdbc/LiferayPool by editing /etc/jetty.standard.FBDriver</driver-class> <user-name>sysdba</user-name> <password>masterkey</password> <min-pool-size>0</min-pool-size> </local-tx-datasource> </datasources> Copy the JDBC driver for to /server/default/lib.classname=org.gdb </connection-url> <driver-class>org.plus.StandardXAPoolDataSource"> <Arg type="Integer">4</Arg> <Set name="MinSize">4</Set> <Set name="MaxSize">15</Set> </New> </Arg> </Call> </New> </Arg> </Call> Copy the JDBC driver for to /lib.Installation and Setup <jndi-name>jdbc/LiferayPool</jndi-name> <connection-url> jdbc:firebirdsql://localhost/opt/data/lportal.FBDriver</Set> <Set name="Url">jdbc:firebirdsql://localhost/opt/data/lportal. JDBC drivers can be found from the database vendor's web site.url=jdbc:firebirdsql://localhost/opt/data/lportal.

xml.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="org.gdb" username="sysdba" password="masterkey" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver to /j2ee/home/lib. JDBC drivers can be found from the database vendor's web site. OracleAS with Firebird Create a data source bound to jdbc/LiferayPool.sql.jdbc.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="org.firebirdsql.jdbc. undeploy it by removing its xml configuration.evermind.evermind.mapper= Copy the JDBC driver for to /lib/ext. JDBC drivers can be found from the database vendor's web site. org.FBDriver as the driver.sql.firebirdsql.FBDriver" url="jdbc:firebirdsql://localhost/opt/data/lportal. 39 . and masterkey as the password.firebirdsql.password=masterkey datasource. Orion with Firebird Create a data source bound to jdbc/LiferayPool. JRun with Firebird Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:firebirdsql://localhost/opt/data/lportal.Installation and Setup datasource.gdb" username="sysdba" password="masterkey" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver for to /lib. and set the proper JDBC properties by editing /config/data-sources.gdb as the URL. JDBC drivers can be found from the database vendor's web site. and set the proper JDBC properties by editing /config/data-sources.FBDriver" url="jdbc:firebirdsql://localhost/opt/data/lportal. create a Tx data source bound to jdbc/LiferayEJB. create a Tx data source bound to jdbc/LiferayEJB. <data-source class="com.xml.jdbc. sysdba as the user name. If there is a duplicate service. Make sure there isn't another data source bound to jdbc/LiferayPool. <data-source class="com.

FBDriver"> <url>jdbc:firebirdsql://localhost/opt/data/lportal. undeploy it by removing its xml configuration.gdb" username="sysdba" password="masterkey" max-pool="100" transactional="false" /> Copy the JDBC driver to /lib. Resin with Firebird Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /conf/resin. sysdba as the user name. Sun JSAS with Firebird Use the Administration Console to do the following: Create a connection pool org. JDBC drivers can be found from the database vendor's web site. <database> <jndi-name>jdbc/LiferayPool</jndi-name> <driver type="org. Make sure there isn't another data source bound to jdbc/LiferayPool.jdbc. If there is a duplicate service. undeploy it by removing its xml configuration.gdb</url> <user>sysdba</user> <password>masterkey</password> </driver> <prepared-statement-cache-size>8</prepared-statement-cache-size> <max-connections>20</max-connections> <max-idle-time>30s</max-idle-time> </database> Copy the JDBC driver to /lib.Installation and Setup Make sure there isn't already another data source bound to jdbc/LiferayPool.commons.jdbc.conf. user40 . JDBC drivers can be found from the database vendor's web site. Make sure there isn't already another data source bound to jdbc/LiferayPool.firebirdsql.firebirdsql. RexIP with Firebird Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /server. The pool properties are driverClassName=org.FBDriver as the driver.FBDriver" url="jdbc:firebirdsql://localhost/opt/data/lportal. If there is a duplicate service.xml.FBDriver. If there is a duplicate service.BasicDataSource as the data source class. undeploy it by removing its xml configuration.firebirdsql.firebirdsql.apache.jdbc. url=jdbc:firebirdsql://localhost/opt/data/lportal. <datasource name="LiferayPool" jndi-name="jdbc/LiferayPool" driver="org.gdb. org.dbcp. Pramati with Firebird Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:firebirdsql://localhost/opt/data/lportal. and masterkey as the password.jdbc.gdb as the URL.

. Tomcat with Firebird For Tomcat 5.FBDriver" url="jdbc:firebirdsql://localhost/opt/data/lportal. <Resource name="jdbc/LiferayPool" auth="Container" type="javax. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/liferay.0.> .x.gdb</value> </parameter> <parameter> <name>username</name> <value>sysdba</value> </parameter> <parameter> <name>password</name> <value>masterkey</value> </parameter> <parameter> <name>maxActive</name> <value>20</value> </parameter> </ResourceParams> </Context> For Tomcat 5.Installation and Setup name=sysdba..firebirdsql. Create a data source bound to jdbc/LiferayPool. JDBC drivers can be found from the database vendor's web site.xml.5. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/ROOT.DataSource" /> <ResourceParams name="jdbc/LiferayPool"> <parameter> <name>driverClassName</name> <value>org. WebLogic with Firebird 41 . and password=masterkey.sql.FBDriver</value> </parameter> <parameter> <name>url</name> <value>jdbc:firebirdsql://localhost/opt/data/lportal. <Context.firebirdsql.DataSource" driverClassName="org.x. <Context..> <Resource name="jdbc/LiferayPool" auth="Container" type="javax.0..x.jdbc.xml.. copy the JDBC driver to /common/lib..jdbc.5.sql.x and 5.gdb" username="sysdba" password="masterkey" maxActive="100" maxIdle="30" maxWait="10000" /> </Context> For Tomcat 5.

dbcp.apache. and password=masterkey.dbcp.commons. Cut and paste the contents of portalhypersonic. DAR files are custom to BES. Create a data source bound to jdbc/LiferayPool.gdb as the URL. The custom properties are driver=org.apache. sysdba as the user name.gdb.jar.Installation and Setup Use the Administration Console to do the following: Create a connection pool using jdbc:firebirdsql://localhost/opt/data/lportal.cpdsadapter.hsqldb. <jndi-definitions> <visitransact-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <driver-datasource-jndiname>datasources/JdsLiferayDriver</driver-datasource-jndiname> <property> <prop-name>connectionType</prop-name> <prop-type>Enumerated</prop-type> <prop-value>Direct</prop-value> </property> <property> <prop-name>dialect</prop-name> <prop-type>Enumerated</prop-type> <prop-value>hypersonic</prop-value> </property> </visitransact-datasource> <driver-datasource> <jndi-name>datasources/JdsLiferayDriver</jndi-name> <datasource-class-name>org.jdbc. commons-pool. user=sysdba.FBDriver. org.cpdsadapter.jar.DriverAdapterCPDS</datasource-cl <log-writer>False</log-writer> <property> <prop-name>driver</prop-name> <prop-type>String</prop-type> <prop-value>org. Copy commons-dbcp.firebirdsql.DriverAdapterCPDS as the implementation class name. and your JDBC driver to /AppServer/lib/ext. WebSphere with Firebird Use the Administrative Console: Resources -> JDBC Providers. Create a data source bound to jdbc/LiferayPool. Create a new user-defined JDBC provider.jdbcDriver</prop-value> </property> <property> <prop-name>url</prop-name> <prop-type>String</prop-type> <prop-value>jdbc:hsqldb:hsql://localhost</prop-value> </property> 42 .dar. Hypersonic Run the Hypersonic Database Manager and log into the database instance. Remove any references in the class path. Set org.firebirdsql.FBDriver as the driver.sql into the manager and excecute the SQL statements. url=jdbc:firebirdsql://localhost/opt/data/lportal. and masterkey as the password.commons. Create a Tx data source bound to jdbc/LiferayEJB.jdbc. You can use the BES Deployment Descriptor Editor to create the DAR file. BES with Hypersonic Create a data source bound to jdbc/LiferayPool by editing jndi-definitions and creating liferay.

xml. JDBC drivers can be found from the database vendor's web site.StandardXADataSource"> <Set name="DriverName">org.enhydra. If there is a duplicate service. JBoss with Hypersonic Create a data source bound to jdbc/LiferayPool by editing liferay-ds.jdbc.jdbcDriver</Set> <Set name="Url">jdbc:hsqldb:hsql://localhost</Set> <Set name="User"></Set> <Set name="Password"></Set> </New> </Arg> <Arg> <New class="org.StandardXAPoolDataSource"> 43 .plus.hsqldb.enhydra.xml.hsqldb. <Call name="addService"> <Arg> <New class="org.mortbay.Installation and Setup <property> <prop-name>username</prop-name> <prop-type>String</prop-type> <prop-value></prop-value> </property> <property> <prop-name>password</prop-name> <prop-type>String</prop-type> <prop-value></prop-value> </property> </driver-datasource> </jndi-definitions> Copy the JDBC driver to a path that can be picked up by BES.jdbcDriver</driver-class> <user-name></user-name> <password></password> <min-pool-size>0</min-pool-size> </local-tx-datasource> </datasources> Copy the JDBC driver for to /server/default/lib. JDBC drivers can be found from the database vendor's web site. Make sure there isn't another data source bound to jdbc/LiferayPool.jetty.JotmService"> <Set name="Name">TransactionMgr</Set> <Call name="addDataSource"> <Arg>jdbc/LiferayPool</Arg> <Arg> <New class="org.jdbc. <datasources> <local-tx-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <connection-url> jdbc:hsqldb:hsql://localhost </connection-url> <driver-class>org. undeploy it by removing its xml configuration. Jetty with Hypersonic Create a data source bound to jdbc/LiferayPool by editing /etc/jetty.pool.standard.

username= datasource.mapper= Copy the JDBC driver for to /lib/ext.sql. create a Tx data source bound to jdbc/LiferayEJB. Make sure there isn't another data source bound to jdbc/LiferayPool.classname=org. datasource.hsqldb.name=jdbc/LiferayPool datasource. JDBC drivers can be found from the database vendor's web site.xml.jdbcDriver datasource. <data-source class="com.evermind.hsqldb. If there is a duplicate service.properties.jdbcDriver" url="jdbc:hsqldb:hsql://localhost" username="" password="" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver to /j2ee/home/lib. and as the password. as the user name. OracleAS with Hypersonic Create a data source bound to jdbc/LiferayPool. JDBC drivers can be found from the database vendor's web site. JDBC drivers can be found from the database vendor's web site. 44 .password= datasource. and set the proper JDBC properties by editing /config/data-sources. JRun with Hypersonic Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:hsqldb:hsql://localhost as the URL.url=jdbc:hsqldb:hsql://localhost datasource.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="org. undeploy it by removing its xml configuration.Installation and Setup <Arg type="Integer">4</Arg> <Set name="MinSize">4</Set> <Set name="MaxSize">15</Set> </New> </Arg> </Call> </New> </Arg> </Call> Copy the JDBC driver for to /lib. JOnAS with Hypersonic Create a data source bound to jdbc/LiferayPool by editing /conf/jonas/liferay-ds.jdbcDriver as the driver.hsqldb. org.

hsqldb. JDBC drivers can be found from the database vendor's web site. and set the proper JDBC properties by editing /config/data-sources. If there is a duplicate service. Make sure there isn't another data source bound to jdbc/LiferayPool.hsqldb. <data-source class="com. undeploy it by removing its xml configuration. RexIP with Hypersonic Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /server. Resin with Hypersonic Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /conf/resin. JDBC drivers can be found from the database vendor's web site.sql. If there is a duplicate service.conf.hsqldb. and as the password.evermind. create a Tx data source bound to jdbc/LiferayEJB. org.xml. <datasource 45 .jdbcDriver"> <url>jdbc:hsqldb:hsql://localhost</url> <user></user> <password></password> </driver> <prepared-statement-cache-size>8</prepared-statement-cache-size> <max-connections>20</max-connections> <max-idle-time>30s</max-idle-time> </database> Copy the JDBC driver to /lib.xml.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="org. Pramati with Hypersonic Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:hsqldb:hsql://localhost as the URL.jdbcDriver as the driver.Installation and Setup Orion with Hypersonic Create a data source bound to jdbc/LiferayPool. <database> <jndi-name>jdbc/LiferayPool</jndi-name> <driver type="org.jdbcDriver" url="jdbc:hsqldb:hsql://localhost" username="" password="" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver for to /lib. as the user name. undeploy it by removing its xml configuration. Make sure there isn't another data source bound to jdbc/LiferayPool.

JDBC drivers can be found from the database vendor's web site. Create a data source bound to jdbc/LiferayPool.dbcp.jdbcDriver" url="jdbc:hsqldb:hsql://localhost" username="" password="" max-pool="100" transactional="false" /> Copy the JDBC driver to /lib.. <Context. Make sure there isn't already another data source bound to jdbc/LiferayPool.> .jdbcDriver</value> </parameter> <parameter> <name>url</name> <value>jdbc:hsqldb:hsql://localhost</value> </parameter> <parameter> <name>username</name> <value></value> </parameter> <parameter> <name>password</name> <value></value> </parameter> <parameter> <name>maxActive</name> <value>20</value> </parameter> </ResourceParams> </Context> For Tomcat 5. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/liferay.apache.0..x.xml. url=jdbc:hsqldb:hsql://localhost.DataSource" /> <ResourceParams name="jdbc/LiferayPool"> <parameter> <name>driverClassName</name> <value>org. and password=.hsqldb.sql. If there is a duplicate service. Sun JSAS with Hypersonic Use the Administration Console to do the following: Create a connection pool org.x.BasicDataSource as the data source class. Tomcat with Hypersonic For Tomcat 5. undeploy it by removing its xml configuration. <Resource name="jdbc/LiferayPool" auth="Container" type="javax.Installation and Setup name="LiferayPool" jndi-name="jdbc/LiferayPool" driver="org. 46 .5. username=.commons.xml..jdbcDriver. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/ROOT..hsqldb. The pool properties are driverClassName=org.hsqldb.

jar. Set org. InterBase Create a database in InterBase located at /opt/data/lportal.apache..DataSource" driverClassName="org.DriverAdapterCPDS as the implementation class name. Create a data source bound to jdbc/LiferayPool. copy the JDBC driver to /common/lib.> <Resource name="jdbc/LiferayPool" auth="Container" type="javax.0.jdbcDriver.cpdsadapter. Remove any references in the class path. DAR files are custom to BES. as the user name. user=.sql.. url=jdbc:hsqldb:hsql://localhost.jdbcDriver" url="jdbc:hsqldb:hsql://localhost" username="" password="" maxActive="100" maxIdle="30" maxWait="10000" /> </Context> For Tomcat 5.hsqldb.x and 5. Create a new user-defined JDBC provider. The custom properties are driver=org. <jndi-definitions> <visitransact-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <driver-datasource-jndiname>datasources/JdsLiferayDriver</driver-datasource-jndiname> <property> <prop-name>connectionType</prop-name> <prop-type>Enumerated</prop-type> 47 . JDBC drivers can be found from the database vendor's web site. type isql -U sysdba -P masterkey -d /opt/data/lportal.commons.sql. Copy commons-dbcp. At your UNIX shell or DOS prompt. Create a data source bound to jdbc/LiferayPool. WebSphere with Hypersonic Use the Administrative Console: Resources -> JDBC Providers. and as the password. Create a Tx data source bound to jdbc/LiferayEJB.x. commons-pool.dar. You can use the BES Deployment Descriptor Editor to create the DAR file.hsqldb.5.hsqldb. and your JDBC driver to /AppServer/lib/ext.gdb. BES with InterBase Create a data source bound to jdbc/LiferayPool by editing jndi-definitions and creating liferay. org.gdb -i portal-firebird. WebLogic with Hypersonic Use the Administration Console to do the following: Create a connection pool using jdbc:hsqldb:hsql://localhost as the URL.jdbcDriver as the driver.dbcp.jar.Installation and Setup <Context. and password=.

JDBC drivers can be found from the database vendor's web site.Installation and Setup <prop-value>Direct</prop-value> </property> <property> <prop-name>dialect</prop-name> <prop-type>Enumerated</prop-type> <prop-value>interbase</prop-value> </property> </visitransact-datasource> <driver-datasource> <jndi-name>datasources/JdsLiferayDriver</jndi-name> <datasource-class-name>org.gdb</prop-value> </property> <property> <prop-name>username</prop-name> <prop-type>String</prop-type> <prop-value>sysdba</prop-value> </property> <property> <prop-name>password</prop-name> <prop-type>String</prop-type> <prop-value>masterkey</prop-value> </property> </driver-datasource> </jndi-definitions> Copy the JDBC driver to a path that can be picked up by BES.commons. JBoss with InterBase Create a data source bound to jdbc/LiferayPool by editing liferay-ds.gdb </connection-url> <driver-class>interbase.Driver</driver-class> <user-name>sysdba</user-name> <password>masterkey</password> <min-pool-size>0</min-pool-size> </local-tx-datasource> </datasources> Copy the JDBC driver for to /server/default/lib. 48 . <datasources> <local-tx-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <connection-url> jdbc:interbase://localhost/opt/data/lportal. If there is a duplicate service.dbcp. JDBC drivers can be found from the database vendor's web site.DriverAdapterCPDS</datasource-cl <log-writer>False</log-writer> <property> <prop-name>driver</prop-name> <prop-type>String</prop-type> <prop-value>interbase.apache.interclient.Driver</prop-value> </property> <property> <prop-name>url</prop-name> <prop-type>String</prop-type> <prop-value>jdbc:interbase://localhost/opt/data/lportal. undeploy it by removing its xml configuration.xml.interclient. Make sure there isn't another data source bound to jdbc/LiferayPool.cpdsadapter.

Installation and Setup

Jetty with InterBase
Create a data source bound to jdbc/LiferayPool by editing /etc/jetty.xml. <Call name="addService"> <Arg> <New class="org.mortbay.jetty.plus.JotmService"> <Set name="Name">TransactionMgr</Set> <Call name="addDataSource"> <Arg>jdbc/LiferayPool</Arg> <Arg> <New class="org.enhydra.jdbc.standard.StandardXADataSource"> <Set name="DriverName">interbase.interclient.Driver</Set> <Set name="Url">jdbc:interbase://localhost/opt/data/lportal.gdb</Set> <Set name="User">sysdba</Set> <Set name="Password">masterkey</Set> </New> </Arg> <Arg> <New class="org.enhydra.jdbc.pool.StandardXAPoolDataSource"> <Arg type="Integer">4</Arg> <Set name="MinSize">4</Set> <Set name="MaxSize">15</Set> </New> </Arg> </Call> </New> </Arg> </Call> Copy the JDBC driver for to /lib. JDBC drivers can be found from the database vendor's web site.

JOnAS with InterBase
Create a data source bound to jdbc/LiferayPool by editing /conf/jonas/liferay-ds.properties. datasource.name=jdbc/LiferayPool datasource.url=jdbc:interbase://localhost/opt/data/lportal.gdb datasource.classname=interbase.interclient.Driver datasource.username=sysdba datasource.password=masterkey datasource.mapper= Copy the JDBC driver for to /lib/ext. JDBC drivers can be found from the database vendor's web site.

JRun with InterBase
Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:interbase://localhost/opt/data/lportal.gdb as the URL, interbase.interclient.Driver as the driver, sysdba as the user name, and masterkey as the password.

OracleAS with InterBase
49

Installation and Setup

Create a data source bound to jdbc/LiferayPool, create a Tx data source bound to jdbc/LiferayEJB, and set the proper JDBC properties by editing /config/data-sources.xml. <data-source class="com.evermind.sql.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="interbase.interclient.Driver" url="jdbc:interbase://localhost/opt/data/lportal.gdb" username="sysdba" password="masterkey" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver to /j2ee/home/lib. JDBC drivers can be found from the database vendor's web site. Make sure there isn't another data source bound to jdbc/LiferayPool. If there is a duplicate service, undeploy it by removing its xml configuration.

Orion with InterBase
Create a data source bound to jdbc/LiferayPool, create a Tx data source bound to jdbc/LiferayEJB, and set the proper JDBC properties by editing /config/data-sources.xml. <data-source class="com.evermind.sql.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="interbase.interclient.Driver" url="jdbc:interbase://localhost/opt/data/lportal.gdb" username="sysdba" password="masterkey" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver for to /lib. JDBC drivers can be found from the database vendor's web site. Make sure there isn't another data source bound to jdbc/LiferayPool. If there is a duplicate service, undeploy it by removing its xml configuration.

Pramati with InterBase
Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:interbase://localhost/opt/data/lportal.gdb as the URL, interbase.interclient.Driver as the driver, sysdba as the user name, and masterkey as the password.

Resin with InterBase
Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /conf/resin.conf. 50

Installation and Setup

<database> <jndi-name>jdbc/LiferayPool</jndi-name> <driver type="interbase.interclient.Driver"> <url>jdbc:interbase://localhost/opt/data/lportal.gdb</url> <user>sysdba</user> <password>masterkey</password> </driver> <prepared-statement-cache-size>8</prepared-statement-cache-size> <max-connections>20</max-connections> <max-idle-time>30s</max-idle-time> </database> Copy the JDBC driver to /lib. JDBC drivers can be found from the database vendor's web site. Make sure there isn't another data source bound to jdbc/LiferayPool. If there is a duplicate service, undeploy it by removing its xml configuration.

RexIP with InterBase
Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /server.xml. <datasource name="LiferayPool" jndi-name="jdbc/LiferayPool" driver="interbase.interclient.Driver" url="jdbc:interbase://localhost/opt/data/lportal.gdb" username="sysdba" password="masterkey" max-pool="100" transactional="false" /> Copy the JDBC driver to /lib. JDBC drivers can be found from the database vendor's web site. Make sure there isn't another data source bound to jdbc/LiferayPool. If there is a duplicate service, undeploy it by removing its xml configuration.

Sun JSAS with InterBase
Use the Administration Console to do the following: Create a connection pool org.apache.commons.dbcp.BasicDataSource as the data source class. The pool properties are driverClassName=interbase.interclient.Driver, url=jdbc:interbase://localhost/opt/data/lportal.gdb, username=sysdba, and password=masterkey. Create a data source bound to jdbc/LiferayPool.

Tomcat with InterBase
For Tomcat 5.0.x, create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/liferay.xml. <Context...> ... <Resource name="jdbc/LiferayPool" auth="Container" type="javax.sql.DataSource" /> 51

Installation and Setup <ResourceParams name="jdbc/LiferayPool"> <parameter> <name>driverClassName</name> <value>interbase. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/ROOT.sql. WebSphere with InterBase Use the Administrative Console: Resources -> JDBC Providers. and masterkey as the password.> <Resource name="jdbc/LiferayPool" auth="Container" type="javax. sysdba as the user name.gdb</value> </parameter> <parameter> <name>username</name> <value>sysdba</value> </parameter> <parameter> <name>password</name> <value>masterkey</value> </parameter> <parameter> <name>maxActive</name> <value>20</value> </parameter> </ResourceParams> </Context> For Tomcat 5.interclient.5..5.Driver</value> </parameter> <parameter> <name>url</name> <value>jdbc:interbase://localhost/opt/data/lportal.x. WebLogic with InterBase Use the Administration Console to do the following: Create a connection pool using jdbc:interbase://localhost/opt/data/lportal. Create a data source bound to jdbc/LiferayPool. <Context.x and 5. interbase.gdb as the URL.gdb" username="sysdba" password="masterkey" maxActive="100" maxIdle="30" maxWait="10000" /> </Context> For Tomcat 5.. JDBC drivers can be found from the database vendor's web site.0.interclient.DataSource" driverClassName="interbase. copy the JDBC driver to /common/lib.interclient. Create a Tx data source bound to jdbc/LiferayEJB.x. 52 .xml.Driver as the driver.Driver" url="jdbc:interbase://localhost/opt/data/lportal.

Set org.interclient. and your JDBC driver to /AppServer/lib/ext.jar. At your UNIX shell or DOS prompt.commons. url=jdbc:interbase://localhost/opt/data/lportal.jds</prop-value> </property> <property> <prop-name>username</prop-name> <prop-type>String</prop-type> <prop-value>sysdba</prop-value> </property> <property> <prop-name>password</prop-name> <prop-type>String</prop-type> <prop-value>masterkey</prop-value> </property> </driver-datasource> </jndi-definitions> 53 .cpdsadapter.DataStoreDriver</prop-value> </property> <property> <prop-name>url</prop-name> <prop-type>String</prop-type> <prop-value>jdbc:borland:dslocal:lportal.commons.dar. Remove any references in the class path. Copy commons-dbcp.dbcp.dbcp. JDataStore Create a database in InterBase located at lportal.Driver.DriverAdapterCPDS as the implementation class name.datastore. user=sysdba.cpdsadapter. <jndi-definitions> <visitransact-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <driver-datasource-jndiname>datasources/JdsLiferayDriver</driver-datasource-jndiname> <property> <prop-name>connectionType</prop-name> <prop-type>Enumerated</prop-type> <prop-value>Direct</prop-value> </property> <property> <prop-name>dialect</prop-name> <prop-type>Enumerated</prop-type> <prop-value>jdatastore</prop-value> </property> </visitransact-datasource> <driver-datasource> <jndi-name>datasources/JdsLiferayDriver</jndi-name> <datasource-class-name>org. type isql -U sysdba -P masterkey -d lportal.borland.DriverAdapterCPDS</datasource-cl <log-writer>False</log-writer> <property> <prop-name>driver</prop-name> <prop-type>String</prop-type> <prop-value>com.apache. Create a data source bound to jdbc/LiferayPool. You can use the BES Deployment Descriptor Editor to create the DAR file.jds -i portal-jdatastore. commons-pool. BES with JDataStore Create a data source bound to jdbc/LiferayPool by editing jndi-definitions and creating liferay.Installation and Setup Create a new user-defined JDBC provider.jar.sql.jds.jdbc.apache.gdb. The custom properties are driver=interbase. DAR files are custom to BES. and password=masterkey.

JDBC drivers can be found from the database vendor's web site.jds</Set> <Set name="User">sysdba</Set> <Set name="Password">masterkey</Set> </New> </Arg> <Arg> <New class="org.jetty. 54 . JDBC drivers can be found from the database vendor's web site.DataStoreDriver</driver-class> <user-name>sysdba</user-name> <password>masterkey</password> <min-pool-size>0</min-pool-size> </local-tx-datasource> </datasources> Copy the JDBC driver for to /server/default/lib.mortbay.JotmService"> <Set name="Name">TransactionMgr</Set> <Call name="addDataSource"> <Arg>jdbc/LiferayPool</Arg> <Arg> <New class="org.enhydra.StandardXADataSource"> <Set name="DriverName">com.StandardXAPoolDataSource"> <Arg type="Integer">4</Arg> <Set name="MinSize">4</Set> <Set name="MaxSize">15</Set> </New> </Arg> </Call> </New> </Arg> </Call> Copy the JDBC driver for to /lib. Make sure there isn't another data source bound to jdbc/LiferayPool. <Call name="addService"> <Arg> <New class="org.Installation and Setup Copy the JDBC driver to a path that can be picked up by BES.jds </connection-url> <driver-class>com.jdbc.datastore.datastore. Jetty with JDataStore Create a data source bound to jdbc/LiferayPool by editing /etc/jetty.xml.standard.borland. If there is a duplicate service.borland.plus.pool. JDBC drivers can be found from the database vendor's web site.DataStoreDriver</Set> <Set name="Url">jdbc:borland:dslocal:lportal.jdbc.xml.enhydra.jdbc. undeploy it by removing its xml configuration.jdbc. JBoss with JDataStore Create a data source bound to jdbc/LiferayPool by editing liferay-ds. <datasources> <local-tx-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <connection-url> jdbc:borland:dslocal:lportal.

xml.jdbc.url=jdbc:borland:dslocal:lportal.username=sysdba datasource.datastore.DataStoreDriver datasource.borland. and set the proper JDBC properties by editing /config/data-sources. and masterkey as the password.evermind. datasource.DataStoreDriver" url="jdbc:borland:dslocal:lportal. JRun with JDataStore Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:borland:dslocal:lportal.mapper= Copy the JDBC driver for to /lib/ext. <data-source class="com.jds datasource. OracleAS with JDataStore Create a data source bound to jdbc/LiferayPool.borland.jdbc.xml.Installation and Setup JOnAS with JDataStore Create a data source bound to jdbc/LiferayPool by editing /conf/jonas/liferay-ds. Make sure there isn't another data source bound to jdbc/LiferayPool.sql.jds" username="sysdba" password="masterkey" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver to /j2ee/home/lib. <data-source class="com. com.borland.DataStoreDriver as the driver.password=masterkey datasource.sql.borland.jdbc.datastore. JDBC drivers can be found from the database vendor's web site. sysdba as the user name.datastore. create a Tx data source bound to jdbc/LiferayEJB. JDBC drivers can be found from the database vendor's web site. If there is a duplicate service.jds as the URL.classname=com.properties.DataStoreDriver" 55 .name=jdbc/LiferayPool datasource.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="com. and set the proper JDBC properties by editing /config/data-sources.jdbc.evermind. create a Tx data source bound to jdbc/LiferayEJB. undeploy it by removing its xml configuration.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="com.datastore. Orion with JDataStore Create a data source bound to jdbc/LiferayPool.

RexIP with JDataStore Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /server. <datasource name="LiferayPool" jndi-name="jdbc/LiferayPool" driver="com. and masterkey as the password.jdbc. If there is a duplicate service. If there is a duplicate service. Resin with JDataStore Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /conf/resin.DataStoreDriver"> <url>jdbc:borland:dslocal:lportal.borland. <database> <jndi-name>jdbc/LiferayPool</jndi-name> <driver type="com.jds</url> <user>sysdba</user> <password>masterkey</password> </driver> <prepared-statement-cache-size>8</prepared-statement-cache-size> <max-connections>20</max-connections> <max-idle-time>30s</max-idle-time> </database> Copy the JDBC driver to /lib.borland.datastore.jds as the URL. com.borland. undeploy it by removing its xml configuration. undeploy it by removing its xml configuration. JDBC drivers can be found from the database vendor's web site. sysdba as the user name. 56 . JDBC drivers can be found from the database vendor's web site.datastore.DataStoreDriver" url="jdbc:borland:dslocal:lportal. Make sure there isn't another data source bound to jdbc/LiferayPool.xml.Installation and Setup url="jdbc:borland:dslocal:lportal.conf.datastore. Pramati with JDataStore Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:borland:dslocal:lportal.jdbc.jdbc. Make sure there isn't another data source bound to jdbc/LiferayPool. JDBC drivers can be found from the database vendor's web site.jds" username="sysdba" password="masterkey" max-pool="100" transactional="false" /> Copy the JDBC driver to /lib.jds" username="sysdba" password="masterkey" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver for to /lib.DataStoreDriver as the driver.

xml.jdbc.x.DataSource" /> <ResourceParams name="jdbc/LiferayPool"> <parameter> <name>driverClassName</name> <value>com.BasicDataSource as the data source class. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/ROOT. and password=masterkey..jdbc.DataStoreDriver" url="jdbc:borland:dslocal:lportal.. username=sysdba.> <Resource name="jdbc/LiferayPool" auth="Container" type="javax. <Resource name="jdbc/LiferayPool" auth="Container" type="javax.borland.0.borland.sql. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/liferay... undeploy it by removing its xml configuration.> .datastore.apache. Tomcat with JDataStore For Tomcat 5. If there is a duplicate service.jds" username="sysdba" password="masterkey" maxActive="100" maxIdle="30" 57 .Installation and Setup Make sure there isn't another data source bound to jdbc/LiferayPool.borland.jdbc.dbcp.DataSource" driverClassName="com.sql.DataStoreDriver. Sun JSAS with JDataStore Use the Administration Console to do the following: Create a connection pool org.xml. Create a data source bound to jdbc/LiferayPool.5. The pool properties are driverClassName=com. url=jdbc:borland:dslocal:lportal..jds.x..commons. <Context. <Context.datastore.DataStoreDriver</value> </parameter> <parameter> <name>url</name> <value>jdbc:borland:dslocal:lportal.jds</value> </parameter> <parameter> <name>username</name> <value>sysdba</value> </parameter> <parameter> <name>password</name> <value>masterkey</value> </parameter> <parameter> <name>maxActive</name> <value>20</value> </parameter> </ResourceParams> </Context> For Tomcat 5.datastore.

x and 5. MySQL Create a database in MySQL called lportal.jds as the URL. At your UNIX shell or DOS prompt.0. Create a data source bound to jdbc/LiferayPool. and your JDBC driver to /AppServer/lib/ext. com. user=sysdba.jdbc. You can use the BES Deployment Descriptor Editor to create the DAR file. and masterkey as the password.jar. To manually update your column type.datastore.DataStoreDriver as the driver.DataStoreDriver. 'f').mysql.mm. sysdba as the user name. Set org.jar. and password=masterkey.jdbc. execute the SQL command alter table TableName modify column columnName tinyint.7.5.x.commons. the new driver stores booleans in columns of type tinyint.borland.datastore. WebLogic with JDataStore Use the Administration Console to do the following: Create a connection pool using jdbc:borland:dslocal:lportal. execute the SQL script update1. Note As of version 1.borland. type mysql lportal < portalmysql.5-1.sql.0.Installation and Setup maxWait="10000" /> </Context> For Tomcat 5.jds.sql. <jndi-definitions> <visitransact-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <driver-datasource-jndiname>datasources/JdsLiferayDriver</driver-datasource-jndiname> <property> 58 . url=jdbc:borland:dslocal:lportal. BES with MySQL Create a data source bound to jdbc/LiferayPool by editing jndi-definitions and creating liferay.dbcp. JDBC drivers can be found from the database vendor's web site. Copy commons-dbcp.Driver is replaced with the latest JDBC driver com. The old driver stored booleans in columns of type enum('t'.8. Follow the additional instructions from this post if you're having character encoding issues. Create a Tx data source bound to jdbc/LiferayEJB. Create a new user-defined JDBC provider. copy the JDBC driver to /common/lib. the old JDBC driver org.cpdsadapter.mysql. DAR files are custom to BES.DriverAdapterCPDS as the implementation class name. The custom properties are driver=com.gjt.apache. Create a data source bound to jdbc/LiferayPool.0-mysql. WebSphere with JDataStore Use the Administrative Console: Resources -> JDBC Providers.8.jdbc. commons-pool. Remove any references in the class path. To automatically update all your tables.dar..Driver.

commons.cpdsadapter.mysql. JDBC drivers can be found from the database vendor's web site.Driver</driver-class> <user-name>test</user-name> <password>test</password> <min-pool-size>0</min-pool-size> </local-tx-datasource> </datasources> Copy the JDBC driver for to /server/default/lib.characterEncoding=UTF-8</pro </property> <property> <prop-name>username</prop-name> <prop-type>String</prop-type> <prop-value>test</prop-value> </property> <property> <prop-name>password</prop-name> <prop-type>String</prop-type> <prop-value>test</prop-value> </property> </driver-datasource> </jndi-definitions> Copy the JDBC driver to a path that can be picked up by BES.xml. If there is a duplicate service.characterEncoding=UTF-8 </connection-url> <driver-class>com.Installation and Setup <prop-name>connectionType</prop-name> <prop-type>Enumerated</prop-type> <prop-value>Direct</prop-value> </property> <property> <prop-name>dialect</prop-name> <prop-type>Enumerated</prop-type> <prop-value>mysql</prop-value> </property> </visitransact-datasource> <driver-datasource> <jndi-name>datasources/JdsLiferayDriver</jndi-name> <datasource-class-name>org. <datasources> <local-tx-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <connection-url> jdbc:mysql://localhost/lportal?useUnicode=true&amp.apache. JBoss with MySQL Create a data source bound to jdbc/LiferayPool by editing liferay-ds.jdbc. 59 .dbcp. JDBC drivers can be found from the database vendor's web site. Make sure there isn't another data source bound to jdbc/LiferayPool.mysql.jdbc. undeploy it by removing its xml configuration.DriverAdapterCPDS</datasource-cl <log-writer>False</log-writer> <property> <prop-name>driver</prop-name> <prop-type>String</prop-type> <prop-value>com.Driver</prop-value> </property> <property> <prop-name>url</prop-name> <prop-type>String</prop-type> <prop-value>jdbc:mysql://localhost/lportal?useUnicode=true&amp.

enhydra.properties.standard.jdbc. JDBC drivers can be found from the database vendor's web site.JotmService"> <Set name="Name">TransactionMgr</Set> <Call name="addDataSource"> <Arg>jdbc/LiferayPool</Arg> <Arg> <New class="org.Driver</Set> <Set name="Url">jdbc:mysql://localhost/lportal?useUnicode=true&amp.mysql.name=jdbc/LiferayPool datasource.xml.password=test datasource.jdbc.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8 datasource.StandardXAPoolDataSource"> <Arg type="Integer">4</Arg> <Set name="MinSize">4</Set> <Set name="MaxSize">15</Set> </New> </Arg> </Call> </New> </Arg> </Call> Copy the JDBC driver for to /lib. com. JOnAS with MySQL Create a data source bound to jdbc/LiferayPool by editing /conf/jonas/liferay-ds. and test as the password.jetty.Driver as the driver.enhydra.jdbc. JRun with MySQL Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8 as the URL.characterEncoding=UTF-8</Set> <Set name="User">test</Set> <Set name="Password">test</Set> </New> </Arg> <Arg> <New class="org.mysql. OracleAS with MySQL 60 .Installation and Setup Jetty with MySQL Create a data source bound to jdbc/LiferayPool by editing /etc/jetty.classname=com. <Call name="addService"> <Arg> <New class="org.plus. datasource.jdbc.username=test datasource.mortbay. JDBC drivers can be found from the database vendor's web site.mapper= Copy the JDBC driver for to /lib/ext.Driver datasource.pool.StandardXADataSource"> <Set name="DriverName">com. test as the user name.mysql.jdbc.

and test as the password. com. undeploy it by removing its xml configuration.sql.mysql. <data-source class="com.evermind. <data-source class="com. If there is a duplicate service.Driver as the driver. JDBC drivers can be found from the database vendor's web site.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="com. create a Tx data source bound to jdbc/LiferayEJB.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="com. undeploy it by removing its xml configuration.sql.Driver" url="jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8" username="test" password="test" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver for to /lib. create a Tx data source bound to jdbc/LiferayEJB.xml. test as the user name.Driver" url="jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8" username="test" password="test" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver to /j2ee/home/lib. and set the proper JDBC properties by editing /config/data-sources.jdbc.jdbc. Pramati with MySQL Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8 as the URL.xml. Make sure there isn't another data source bound to jdbc/LiferayPool.jdbc.Installation and Setup Create a data source bound to jdbc/LiferayPool. Orion with MySQL Create a data source bound to jdbc/LiferayPool.mysql. JDBC drivers can be found from the database vendor's web site. If there is a duplicate service. and set the proper JDBC properties by editing /config/data-sources. Resin with MySQL 61 . Make sure there isn't another data source bound to jdbc/LiferayPool.mysql.evermind.

JDBC drivers can be found from the database vendor's web site. Make sure there isn't another data source bound to jdbc/LiferayPool. <database> <jndi-name>jdbc/LiferayPool</jndi-name> <driver type="com. If there is a duplicate service.characterEncoding=UTF-8</url> <user>test</user> <password>test</password> </driver> <prepared-statement-cache-size>8</prepared-statement-cache-size> <max-connections>20</max-connections> <max-idle-time>30s</max-idle-time> </database> Copy the JDBC driver to /lib.Installation and Setup Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /conf/resin. Make sure there isn't another data source bound to jdbc/LiferayPool.xml.commons.conf.Driver"> <url>jdbc:mysql://localhost/lportal?useUnicode=true&amp.x.mysql. RexIP with MySQL Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /server. If there is a duplicate service. username=test. <datasource name="LiferayPool" jndi-name="jdbc/LiferayPool" driver="com.mysql. <Context.jdbc.BasicDataSource as the data source class... <Resource name="jdbc/LiferayPool" auth="Container" 62 . url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8.mysql.Driver. undeploy it by removing its xml configuration. The pool properties are driverClassName=com. Create a data source bound to jdbc/LiferayPool. and password=test.xml.apache..jdbc.0..dbcp. undeploy it by removing its xml configuration. Tomcat with MySQL For Tomcat 5.Driver" url="jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8" username="test" password="test" max-pool="100" transactional="false" /> Copy the JDBC driver to /lib. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/liferay. Sun JSAS with MySQL Use the Administration Console to do the following: Create a connection pool org.jdbc.> . JDBC drivers can be found from the database vendor's web site.

com. JDBC drivers can be found from the database vendor's web site.5.x. and test as the password.sql.mysql.0.Driver</value> </parameter> <parameter> <name>url</name> <value>jdbc:mysql://localhost/lportal?useUnicode=true&amp. <Context.Driver as the driver.mysql.sql.x.mysql.jdbc.DataSource" driverClassName="com. WebSphere with MySQL Use the Administrative Console: Resources -> JDBC Providers.x and 5. WebLogic with MySQL Use the Administration Console to do the following: Create a connection pool using jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8 as the URL.jdbc. copy the JDBC driver to /common/lib..> <Resource name="jdbc/LiferayPool" auth="Container" type="javax.characterEncoding=UTF-8</value> </parameter> <parameter> <name>username</name> <value>test</value> </parameter> <parameter> <name>password</name> <value>test</value> </parameter> <parameter> <name>maxActive</name> <value>20</value> </parameter> </ResourceParams> </Context> For Tomcat 5..xml. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/ROOT. Create a Tx data source bound to jdbc/LiferayEJB. 63 .5.jdbc. Create a data source bound to jdbc/LiferayPool.Driver" url="jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8" username="test" password="test" maxActive="100" maxIdle="30" maxWait="10000" /> </Context> For Tomcat 5.DataSource" /> <ResourceParams name="jdbc/LiferayPool"> <parameter> <name>driverClassName</name> <value>com. test as the user name.Installation and Setup type="javax.

Installation and Setup

Create a new user-defined JDBC provider. Remove any references in the class path. Set org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS as the implementation class name. Copy commons-dbcp.jar, commons-pool.jar, and your JDBC driver to /AppServer/lib/ext. Create a data source bound to jdbc/LiferayPool. The custom properties are driver=com.mysql.jdbc.Driver, url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8, user=test, and password=test.

Oracle
Create a database in Oracle called lportal. The Oracle 9 and 10 dump scripts are available here [http://www.liferay.com/web/guest/downloads]. Note: Do not use the default Liferay JDBC driver! The Liferay Driver was required in previous versions to work around a bug in Oracle. This is no longer required. You must use the Oracle 10g driver located in classes12.jar whether or not you are using Oracle 9 or Oracle 10. The location of classes12.jar is usually at /oracle/product/10.2.0/db_1/jdbc/lib/classes12.jar but may be different depending on the directory where you installed Oracle.

BES with Oracle
Create a data source bound to jdbc/LiferayPool by editing jndi-definitions and creating liferay.dar. DAR files are custom to BES. You can use the BES Deployment Descriptor Editor to create the DAR file.

<jndi-definitions> <visitransact-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <driver-datasource-jndiname>datasources/JdsLiferayDriver</driver-datasource-jndiname> <property> <prop-name>connectionType</prop-name> <prop-type>Enumerated</prop-type> <prop-value>Direct</prop-value> </property> <property> <prop-name>dialect</prop-name> <prop-type>Enumerated</prop-type> <prop-value>oracle</prop-value> </property> </visitransact-datasource> <driver-datasource> <jndi-name>datasources/JdsLiferayDriver</jndi-name> <datasource-class-name>org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS</datasource-cl <log-writer>False</log-writer> <property> <prop-name>driver</prop-name> <prop-type>String</prop-type> <prop-value>com.liferay.jdbc.LiferayDriver</prop-value> </property> <property> <prop-name>url</prop-name> <prop-type>String</prop-type> <prop-value>jdbc:oracle:thin:@localhost:1521:orcl</prop-value> </property> <property> <prop-name>username</prop-name> <prop-type>String</prop-type> <prop-value>test</prop-value> </property> <property> <prop-name>password</prop-name> 64

Installation and Setup

<prop-type>String</prop-type> <prop-value>test</prop-value> </property> </driver-datasource> </jndi-definitions> Copy the JDBC driver to a path that can be picked up by BES. JDBC drivers can be found from the database vendor's web site.

JBoss with Oracle
Create a data source bound to jdbc/LiferayPool by editing liferay-ds.xml. <datasources> <local-tx-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <connection-url> jdbc:oracle:thin:@localhost:1521:orcl </connection-url> <driver-class>com.liferay.jdbc.LiferayDriver</driver-class> <user-name>test</user-name> <password>test</password> <min-pool-size>0</min-pool-size> </local-tx-datasource> </datasources> Copy the JDBC driver for to /server/default/lib. JDBC drivers can be found from the database vendor's web site. Make sure there isn't another data source bound to jdbc/LiferayPool. If there is a duplicate service, undeploy it by removing its xml configuration.

Jetty with Oracle
Create a data source bound to jdbc/LiferayPool by editing /etc/jetty.xml. <Call name="addService"> <Arg> <New class="org.mortbay.jetty.plus.JotmService"> <Set name="Name">TransactionMgr</Set> <Call name="addDataSource"> <Arg>jdbc/LiferayPool</Arg> <Arg> <New class="org.enhydra.jdbc.standard.StandardXADataSource"> <Set name="DriverName">com.liferay.jdbc.LiferayDriver</Set> <Set name="Url">jdbc:oracle:thin:@localhost:1521:orcl</Set> <Set name="User">test</Set> <Set name="Password">test</Set> </New> </Arg> <Arg> <New class="org.enhydra.jdbc.pool.StandardXAPoolDataSource"> <Arg type="Integer">4</Arg> <Set name="MinSize">4</Set> <Set name="MaxSize">15</Set> </New> </Arg> 65

Installation and Setup

</Call> </New> </Arg> </Call> Copy the JDBC driver for to /lib. JDBC drivers can be found from the database vendor's web site.

JOnAS with Oracle
Create a data source bound to jdbc/LiferayPool by editing /conf/jonas/liferay-ds.properties. datasource.name=jdbc/LiferayPool datasource.url=jdbc:oracle:thin:@localhost:1521:orcl datasource.classname=com.liferay.jdbc.LiferayDriver datasource.username=test datasource.password=test datasource.mapper= Copy the JDBC driver for to /lib/ext. JDBC drivers can be found from the database vendor's web site.

JRun with Oracle
Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:oracle:thin:@localhost:1521:orcl as the URL, com.liferay.jdbc.LiferayDriver as the driver, test as the user name, and test as the password.

OracleAS with Oracle
Create a data source bound to jdbc/LiferayPool, create a Tx data source bound to jdbc/LiferayEJB, and set the proper JDBC properties by editing /config/data-sources.xml. <data-source class="com.evermind.sql.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="com.liferay.jdbc.LiferayDriver" url="jdbc:oracle:thin:@localhost:1521:orcl" username="test" password="test" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver to /j2ee/home/lib. JDBC drivers can be found from the database vendor's web site. Make sure there isn't another data source bound to jdbc/LiferayPool. If there is a duplicate service, undeploy it by removing its xml configuration.

Orion with Oracle
Create a data source bound to jdbc/LiferayPool, create a Tx data source bound to jdbc/LiferayEJB, and set the proper JDBC properties by editing /config/data-sources.xml.

66

com.LiferayDriver" url="jdbc:oracle:thin:@localhost:1521:orcl" username="test" password="test" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver for to /lib. <database> <jndi-name>jdbc/LiferayPool</jndi-name> <driver type="com.liferay.liferay. Pramati with Oracle Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:oracle:thin:@localhost:1521:orcl as the URL. RexIP with Oracle Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /server.liferay.sql.Installation and Setup <data-source class="com. JDBC drivers can be found from the database vendor's web site. Make sure there isn't another data source bound to jdbc/LiferayPool. If there is a duplicate service. JDBC drivers can be found from the database vendor's web site.jdbc.conf. undeploy it by removing its xml configuration.xml. undeploy it by removing its xml configuration.LiferayDriver as the driver.jdbc. test as the user name. If there is a duplicate service.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="com.LiferayDriver"> <url>jdbc:oracle:thin:@localhost:1521:orcl</url> <user>test</user> <password>test</password> </driver> <prepared-statement-cache-size>8</prepared-statement-cache-size> <max-connections>20</max-connections> <max-idle-time>30s</max-idle-time> </database> Copy the JDBC driver to /lib.LiferayDriver" url="jdbc:oracle:thin:@localhost:1521:orcl" username="test" password="test" 67 .evermind. <datasource name="LiferayPool" jndi-name="jdbc/LiferayPool" driver="com.liferay. Make sure there isn't another data source bound to jdbc/LiferayPool. Resin with Oracle Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /conf/resin.jdbc.jdbc. and test as the password.

url=jdbc:oracle:thin:@localhost:1521:orcl. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/liferay.x.. The pool properties are driverClassName=com.LiferayDriver</value> </parameter> <parameter> <name>url</name> <value>jdbc:oracle:thin:@localhost:1521:orcl</value> </parameter> <parameter> <name>username</name> <value>test</value> </parameter> <parameter> <name>password</name> <value>test</value> </parameter> <parameter> <name>maxActive</name> <value>20</value> </parameter> </ResourceParams> </Context> For Tomcat 5. If there is a duplicate service..jdbc.liferay.LiferayDriver. Sun JSAS with Oracle Use the Administration Console to do the following: Create a connection pool org. JDBC drivers can be found from the database vendor's web site.liferay.. Make sure there isn't another data source bound to jdbc/LiferayPool. <Context.BasicDataSource as the data source class.> <Resource name="jdbc/LiferayPool" 68 .. Create a data source bound to jdbc/LiferayPool. undeploy it by removing its xml configuration. username=test.dbcp.sql.5. <Resource name="jdbc/LiferayPool" auth="Container" type="javax.DataSource" /> <ResourceParams name="jdbc/LiferayPool"> <parameter> <name>driverClassName</name> <value>com. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/ROOT. and password=test.> .commons.x.Installation and Setup max-pool="100" transactional="false" /> Copy the JDBC driver to /lib. <Context. Tomcat with Oracle For Tomcat 5.xml..0.jdbc..apache.xml.

liferay.LiferayDriver" url="jdbc:oracle:thin:@localhost:1521:orcl" username="test" password="test" maxActive="100" maxIdle="30" maxWait="10000" /> </Context> For Tomcat 5.5. copy the JDBC driver to /common/lib. commons-pool.dbcp.dar.commons.jar.LiferayDriver. <jndi-definitions> <visitransact-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <driver-datasource-jndiname>datasources/JdsLiferayDriver</driver-datasource-jndiname> <property> <prop-name>connectionType</prop-name> <prop-type>Enumerated</prop-type> <prop-value>Direct</prop-value> </property> <property> <prop-name>dialect</prop-name> 69 .cpdsadapter.sql. test as the user name. JDBC drivers can be found from the database vendor's web site. com.DataSource" driverClassName="com. type psql -d lportal -f portal-postgresql.Installation and Setup auth="Container" type="javax.liferay. Create a data source bound to jdbc/LiferayPool.sql. Copy commons-dbcp. Create a Tx data source bound to jdbc/LiferayEJB. WebLogic with Oracle Use the Administration Console to do the following: Create a connection pool using jdbc:oracle:thin:@localhost:1521:orcl as the URL. url=jdbc:oracle:thin:@localhost:1521:orcl. The custom properties are driver=com. BES with PostgreSQL Create a data source bound to jdbc/LiferayPool by editing jndi-definitions and creating liferay. and password=test. and your JDBC driver to /AppServer/lib/ext. user=test.0.jdbc. Create a data source bound to jdbc/LiferayPool. Set org.liferay. and test as the password.jdbc.jdbc. DAR files are custom to BES. PostgreSQL Create a database in PostgreSQL called lportal.DriverAdapterCPDS as the implementation class name.apache.x and 5. You can use the BES Deployment Descriptor Editor to create the DAR file.LiferayDriver as the driver. At your UNIX shell. WebSphere with Oracle Use the Administrative Console: Resources -> JDBC Providers.jar.x. Remove any references in the class path. Create a new user-defined JDBC provider.

DriverAdapterCPDS</datasource-cl <log-writer>False</log-writer> <property> <prop-name>driver</prop-name> <prop-type>String</prop-type> <prop-value>org.dbcp. JBoss with PostgreSQL Create a data source bound to jdbc/LiferayPool by editing liferay-ds.Driver</prop-value> </property> <property> <prop-name>url</prop-name> <prop-type>String</prop-type> <prop-value>jdbc:postgresql://localhost/lportal</prop-value> </property> <property> <prop-name>username</prop-name> <prop-type>String</prop-type> <prop-value>test</prop-value> </property> <property> <prop-name>password</prop-name> <prop-type>String</prop-type> <prop-value>test</prop-value> </property> </driver-datasource> </jndi-definitions> Copy the JDBC driver to a path that can be picked up by BES. 70 .commons. JDBC drivers can be found from the database vendor's web site. If there is a duplicate service. <datasources> <local-tx-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <connection-url> jdbc:postgresql://localhost/lportal </connection-url> <driver-class>org.xml.xml.apache.Driver</driver-class> <user-name>test</user-name> <password>test</password> <min-pool-size>0</min-pool-size> </local-tx-datasource> </datasources> Copy the JDBC driver for to /server/default/lib. Make sure there isn't another data source bound to jdbc/LiferayPool.Installation and Setup <prop-type>Enumerated</prop-type> <prop-value>postgresql</prop-value> </property> </visitransact-datasource> <driver-datasource> <jndi-name>datasources/JdsLiferayDriver</jndi-name> <datasource-class-name>org.cpdsadapter. undeploy it by removing its xml configuration. JDBC drivers can be found from the database vendor's web site.postgresql.postgresql. Jetty with PostgreSQL Create a data source bound to jdbc/LiferayPool by editing /etc/jetty.

org. create a Tx data source bound to jdbc/LiferayEJB.standard.plus.Driver</Set> <Set name="Url">jdbc:postgresql://localhost/lportal</Set> <Set name="User">test</Set> <Set name="Password">test</Set> </New> </Arg> <Arg> <New class="org.DriverManagerDataSource" name="Liferay" 71 . OracleAS with PostgreSQL Create a data source bound to jdbc/LiferayPool.jdbc.url=jdbc:postgresql://localhost/lportal datasource.properties. JRun with PostgreSQL Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:postgresql://localhost/lportal as the URL. and set the proper JDBC properties by editing /config/data-sources. datasource.name=jdbc/LiferayPool datasource.username=test datasource.password=test datasource.Installation and Setup <Call name="addService"> <Arg> <New class="org.mortbay.StandardXADataSource"> <Set name="DriverName">org.enhydra.postgresql. JDBC drivers can be found from the database vendor's web site.mapper= Copy the JDBC driver for to /lib/ext.Driver as the driver.enhydra.sql.JotmService"> <Set name="Name">TransactionMgr</Set> <Call name="addDataSource"> <Arg>jdbc/LiferayPool</Arg> <Arg> <New class="org. and test as the password. JDBC drivers can be found from the database vendor's web site.jdbc.pool.postgresql.StandardXAPoolDataSource"> <Arg type="Integer">4</Arg> <Set name="MinSize">4</Set> <Set name="MaxSize">15</Set> </New> </Arg> </Call> </New> </Arg> </Call> Copy the JDBC driver for to /lib. <data-source class="com.postgresql.jetty.Driver datasource. JOnAS with PostgreSQL Create a data source bound to jdbc/LiferayPool by editing /conf/jonas/liferay-ds.evermind.classname=org.xml. test as the user name.

xml. undeploy it by removing its xml configuration.Driver"> <url>jdbc:postgresql://localhost/lportal</url> <user>test</user> 72 .postgresql. <data-source class="com. Resin with PostgreSQL Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /conf/resin.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="org. Pramati with PostgreSQL Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:postgresql://localhost/lportal as the URL. JDBC drivers can be found from the database vendor's web site.Driver" url="jdbc:postgresql://localhost/lportal" username="test" password="test" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver to /j2ee/home/lib. create a Tx data source bound to jdbc/LiferayEJB.Driver" url="jdbc:postgresql://localhost/lportal" username="test" password="test" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver for to /lib.Installation and Setup location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="org.Driver as the driver. and set the proper JDBC properties by editing /config/data-sources. Make sure there isn't another data source bound to jdbc/LiferayPool. <database> <jndi-name>jdbc/LiferayPool</jndi-name> <driver type="org. org.conf. undeploy it by removing its xml configuration. test as the user name.evermind.postgresql.postgresql. JDBC drivers can be found from the database vendor's web site.sql. Make sure there isn't another data source bound to jdbc/LiferayPool. If there is a duplicate service. If there is a duplicate service.postgresql. and test as the password. Orion with PostgreSQL Create a data source bound to jdbc/LiferayPool.

Driver" url="jdbc:postgresql://localhost/lportal" username="test" password="test" max-pool="100" transactional="false" /> Copy the JDBC driver to /lib.xml. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/liferay.Driver</value> </parameter> 73 . Tomcat with PostgreSQL For Tomcat 5. If there is a duplicate service. JDBC drivers can be found from the database vendor's web site. Make sure there isn't another data source bound to jdbc/LiferayPool.. <datasource name="LiferayPool" jndi-name="jdbc/LiferayPool" driver="org. <Resource name="jdbc/LiferayPool" auth="Container" type="javax.> .sql. url=jdbc:postgresql://localhost/lportal.apache.x. undeploy it by removing its xml configuration. Create a data source bound to jdbc/LiferayPool.BasicDataSource as the data source class. The pool properties are driverClassName=org.postgresql. If there is a duplicate service..Driver. <Context. JDBC drivers can be found from the database vendor's web site.DataSource" /> <ResourceParams name="jdbc/LiferayPool"> <parameter> <name>driverClassName</name> <value>org.xml.dbcp..Installation and Setup <password>test</password> </driver> <prepared-statement-cache-size>8</prepared-statement-cache-size> <max-connections>20</max-connections> <max-idle-time>30s</max-idle-time> </database> Copy the JDBC driver to /lib.commons. RexIP with PostgreSQL Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /server. undeploy it by removing its xml configuration.postgresql. username=test.0.postgresql. Sun JSAS with PostgreSQL Use the Administration Console to do the following: Create a connection pool org.. Make sure there isn't another data source bound to jdbc/LiferayPool. and password=test.

xml. Copy commons-dbcp.commons.cpdsadapter.x.jar.x and 5.. <Context.DataSource" driverClassName="org.> <Resource name="jdbc/LiferayPool" auth="Container" type="javax.dbcp.5.postgresql. Create a Tx data source bound to jdbc/LiferayEJB. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/ROOT. Create a data source bound to jdbc/LiferayPool. Set org.jar. JDBC drivers can be found from the database vendor's web site.Driver as the driver. org. test as the user name. and test as the password. 74 .Driver" url="jdbc:postgresql://localhost/lportal" username="test" password="test" maxActive="100" maxIdle="30" maxWait="10000" /> </Context> For Tomcat 5.sql.DriverAdapterCPDS as the implementation class name.. copy the JDBC driver to /common/lib. Remove any references in the class path. WebLogic with PostgreSQL Use the Administration Console to do the following: Create a connection pool using jdbc:postgresql://localhost/lportal as the URL.postgresql. commons-pool.x. WebSphere with PostgreSQL Use the Administrative Console: Resources -> JDBC Providers. Create a new user-defined JDBC provider. and your JDBC driver to /AppServer/lib/ext.0.5.apache.Installation and Setup <parameter> <name>url</name> <value>jdbc:postgresql://localhost/lportal</value> </parameter> <parameter> <name>username</name> <value>test</value> </parameter> <parameter> <name>password</name> <value>test</value> </parameter> <parameter> <name>maxActive</name> <value>20</value> </parameter> </ResourceParams> </Context> For Tomcat 5.

Driver.DriverAdapterCPDS</datasource-cl <log-writer>False</log-writer> <property> <prop-name>driver</prop-name> <prop-type>String</prop-type> <prop-value>com.sap. Load the script named portal-sap.Installation and Setup Create a data source bound to jdbc/LiferayPool.dar. JBoss with SAP Create a data source bound to jdbc/LiferayPool by editing liferay-ds. BES with SAP Create a data source bound to jdbc/LiferayPool by editing jndi-definitions and creating liferay.apache. The custom properties are driver=org.sql. and password=test.cpdsadapter.postgresql. You can use the BES Deployment Descriptor Editor to create the DAR file. DAR files are custom to BES.xml. user=test.dbtech. url=jdbc:postgresql://localhost/lportal. <jndi-definitions> <visitransact-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <driver-datasource-jndiname>datasources/JdsLiferayDriver</driver-datasource-jndiname> <property> <prop-name>connectionType</prop-name> <prop-type>Enumerated</prop-type> <prop-value>Direct</prop-value> </property> <property> <prop-name>dialect</prop-name> <prop-type>Enumerated</prop-type> <prop-value>sapdb</prop-value> </property> </visitransact-datasource> <driver-datasource> <jndi-name>datasources/JdsLiferayDriver</jndi-name> <datasource-class-name>org. SAP Create a database in SAP called lportal.dbcp. 75 .commons. JDBC drivers can be found from the database vendor's web site.DriverSapDB</prop-value> </property> <property> <prop-name>url</prop-name> <prop-type>String</prop-type> <prop-value>jdbc:sapdb://localhost/lportal</prop-value> </property> <property> <prop-name>username</prop-name> <prop-type>String</prop-type> <prop-value>test</prop-value> </property> <property> <prop-name>password</prop-name> <prop-type>String</prop-type> <prop-value>test</prop-value> </property> </driver-datasource> </jndi-definitions> Copy the JDBC driver to a path that can be picked up by BES.jdbc.

datasource. Make sure there isn't another data source bound to jdbc/LiferayPool.enhydra.xml.classname=com.jdbc.StandardXAPoolDataSource"> <Arg type="Integer">4</Arg> <Set name="MinSize">4</Set> <Set name="MaxSize">15</Set> </New> </Arg> </Call> </New> </Arg> </Call> Copy the JDBC driver for to /lib.DriverSapDB 76 .properties.sap.dbtech. If there is a duplicate service.pool.enhydra.sap.jdbc.jetty. Jetty with SAP Create a data source bound to jdbc/LiferayPool by editing /etc/jetty.jdbc. <Call name="addService"> <Arg> <New class="org.plus. JDBC drivers can be found from the database vendor's web site.dbtech. undeploy it by removing its xml configuration.name=jdbc/LiferayPool datasource.url=jdbc:sapdb://localhost/lportal datasource.JotmService"> <Set name="Name">TransactionMgr</Set> <Call name="addDataSource"> <Arg>jdbc/LiferayPool</Arg> <Arg> <New class="org.mortbay.Installation and Setup <datasources> <local-tx-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <connection-url> jdbc:sapdb://localhost/lportal </connection-url> <driver-class>com.jdbc. JOnAS with SAP Create a data source bound to jdbc/LiferayPool by editing /conf/jonas/liferay-ds.DriverSapDB</Set> <Set name="Url">jdbc:sapdb://localhost/lportal</Set> <Set name="User">test</Set> <Set name="Password">test</Set> </New> </Arg> <Arg> <New class="org.jdbc.DriverSapDB</driver-class> <user-name>test</user-name> <password>test</password> <min-pool-size>0</min-pool-size> </local-tx-datasource> </datasources> Copy the JDBC driver for to /server/default/lib.sap.dbtech. JDBC drivers can be found from the database vendor's web site.StandardXADataSource"> <Set name="DriverName">com.standard.

dbtech. If there is a duplicate service. Make sure there isn't another data source bound to jdbc/LiferayPool.dbtech.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="com. com.DriverSapDB" url="jdbc:sapdb://localhost/lportal" username="test" password="test" inactivity-timeout="30" schema="database-schemas/" /> 77 . JDBC drivers can be found from the database vendor's web site.DriverSapDB as the driver. create a Tx data source bound to jdbc/LiferayEJB.password=test datasource. and test as the password.xml.evermind.sap. JDBC drivers can be found from the database vendor's web site.xml. undeploy it by removing its xml configuration.dbtech.jdbc. JRun with SAP Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:sapdb://localhost/lportal as the URL.jdbc.sap.DriverSapDB" url="jdbc:sapdb://localhost/lportal" username="test" password="test" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver to /j2ee/home/lib.sap. and set the proper JDBC properties by editing /config/data-sources.username=test datasource.jdbc. Orion with SAP Create a data source bound to jdbc/LiferayPool. create a Tx data source bound to jdbc/LiferayEJB. test as the user name. and set the proper JDBC properties by editing /config/data-sources.sql.sql.mapper= Copy the JDBC driver for to /lib/ext. <data-source class="com.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="com. <data-source class="com.Installation and Setup datasource. OracleAS with SAP Create a data source bound to jdbc/LiferayPool.evermind.

conf. undeploy it by removing its xml configuration.jdbc. Pramati with SAP Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:sapdb://localhost/lportal as the URL. RexIP with SAP Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /server.dbtech. If there is a duplicate service. and test as the password.DriverSapDB" url="jdbc:sapdb://localhost/lportal" username="test" password="test" max-pool="100" transactional="false" /> Copy the JDBC driver to /lib. JDBC drivers can be found from the database vendor's web site. undeploy it by removing its xml configuration.dbtech. test as the user name. If there is a duplicate service. Make sure there isn't another data source bound to jdbc/LiferayPool.Installation and Setup Copy the JDBC driver for to /lib. <datasource name="LiferayPool" jndi-name="jdbc/LiferayPool" driver="com. If there is a duplicate service.jdbc.DriverSapDB"> <url>jdbc:sapdb://localhost/lportal</url> <user>test</user> <password>test</password> </driver> <prepared-statement-cache-size>8</prepared-statement-cache-size> <max-connections>20</max-connections> <max-idle-time>30s</max-idle-time> </database> Copy the JDBC driver to /lib. Sun JSAS with SAP Use the Administration Console to do the following: 78 . Make sure there isn't another data source bound to jdbc/LiferayPool. Resin with SAP Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /conf/resin. <database> <jndi-name>jdbc/LiferayPool</jndi-name> <driver type="com. Make sure there isn't another data source bound to jdbc/LiferayPool.sap.DriverSapDB as the driver. com. JDBC drivers can be found from the database vendor's web site. undeploy it by removing its xml configuration. JDBC drivers can be found from the database vendor's web site.dbtech.sap.sap.jdbc.xml.

The pool properties are driverClassName=com. copy the JDBC driver to /common/lib..sql. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/liferay.DriverSapDB" url="jdbc:sapdb://localhost/lportal" username="test" password="test" maxActive="100" maxIdle="30" maxWait="10000" /> </Context> For Tomcat 5.sap.sap. <Resource name="jdbc/LiferayPool" auth="Container" type="javax.. Create a data source bound to jdbc/LiferayPool.0.x.5. Tomcat with SAP For Tomcat 5. <Context.> . username=test. and password=test.DataSource" driverClassName="com. JDBC drivers can be found from the database vendor's web site.commons...DataSource" /> <ResourceParams name="jdbc/LiferayPool"> <parameter> <name>driverClassName</name> <value>com.DriverSapDB</value> </parameter> <parameter> <name>url</name> <value>jdbc:sapdb://localhost/lportal</value> </parameter> <parameter> <name>username</name> <value>test</value> </parameter> <parameter> <name>password</name> <value>test</value> </parameter> <parameter> <name>maxActive</name> <value>20</value> </parameter> </ResourceParams> </Context> For Tomcat 5.BasicDataSource as the data source class. 79 .dbtech.. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/ROOT.dbtech.sap.> <Resource name="jdbc/LiferayPool" auth="Container" type="javax.dbtech.dbcp..0.xml.x.DriverSapDB.apache. url=jdbc:sapdb://localhost/lportal. <Context.jdbc.x.jdbc.x and 5.jdbc.sql.Installation and Setup Create a connection pool org.xml.5.

jdbc.apache.sql.dbtech. Set org. The custom properties are driver=com. <jndi-definitions> <visitransact-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <driver-datasource-jndiname>datasources/JdsLiferayDriver</driver-datasource-jndiname> <property> <prop-name>connectionType</prop-name> <prop-type>Enumerated</prop-type> <prop-value>Direct</prop-value> </property> <property> <prop-name>dialect</prop-name> <prop-type>Enumerated</prop-type> <prop-value>sqlserver</prop-value> </property> </visitransact-datasource> <driver-datasource> <jndi-name>datasources/JdsLiferayDriver</jndi-name> <datasource-class-name>org.dbcp.jtds. com.sap.DriverSapDB as the driver. test as the user name. You can use the BES Deployment Descriptor Editor to create the DAR file. SQL Server Create a database in SQL Server called lportal. url=jdbc:sapdb://localhost/lportal. Create a data source bound to jdbc/LiferayPool.sourceforge. and password=test. and your JDBC driver to /AppServer/lib/ext. Use Enterprise Manager to load the script named portalsql-server.DriverSapDB.cpdsadapter. BES with SQL Server Create a data source bound to jdbc/LiferayPool by editing jndi-definitions and creating liferay.Driver</prop-value> </property> <property> <prop-name>url</prop-name> 80 . Remove any references in the class path.commons.commons.Installation and Setup WebLogic with SAP Use the Administration Console to do the following: Create a connection pool using jdbc:sapdb://localhost/lportal as the URL.apache.sap. Create a data source bound to jdbc/LiferayPool. Copy commons-dbcp.cpdsadapter.jdbc. Create a new user-defined JDBC provider.DriverAdapterCPDS as the implementation class name.dbtech. user=test. WebSphere with SAP Use the Administrative Console: Resources -> JDBC Providers.jdbc.DriverAdapterCPDS</datasource-cl <log-writer>False</log-writer> <property> <prop-name>driver</prop-name> <prop-type>String</prop-type> <prop-value>net.jar.jar. Create a Tx data source bound to jdbc/LiferayEJB.dar.dbcp. and test as the password. commons-pool. DAR files are custom to BES.

plus.jdbc.jdbc. Jetty with SQL Server Create a data source bound to jdbc/LiferayPool by editing /etc/jetty.xml.sourceforge.StandardXADataSource"> <Set name="DriverName">net.Driver</Set> <Set name="Url">jdbc:jtds:sqlserver://localhost/lportal</Set> <Set name="User">test</Set> <Set name="Password">test</Set> 81 .Driver</driver-class> <user-name>test</user-name> <password>test</password> <min-pool-size>0</min-pool-size> </local-tx-datasource> </datasources> Copy the JDBC driver for to /server/default/lib. JDBC drivers can be found from the database vendor's web site. JBoss with SQL Server Create a data source bound to jdbc/LiferayPool by editing liferay-ds. JDBC drivers can be found from the database vendor's web site.mortbay.jetty.enhydra. Make sure there isn't another data source bound to jdbc/LiferayPool.sourceforge.jdbc. undeploy it by removing its xml configuration.xml.jtds. <Call name="addService"> <Arg> <New class="org.JotmService"> <Set name="Name">TransactionMgr</Set> <Call name="addDataSource"> <Arg>jdbc/LiferayPool</Arg> <Arg> <New class="org.jtds. <datasources> <local-tx-datasource> <jndi-name>jdbc/LiferayPool</jndi-name> <connection-url> jdbc:jtds:sqlserver://localhost/lportal </connection-url> <driver-class>net. If there is a duplicate service.Installation and Setup <prop-type>String</prop-type> <prop-value>jdbc:jtds:sqlserver://localhost/lportal</prop-value> </property> <property> <prop-name>username</prop-name> <prop-type>String</prop-type> <prop-value>test</prop-value> </property> <property> <prop-name>password</prop-name> <prop-type>String</prop-type> <prop-value>test</prop-value> </property> </driver-datasource> </jndi-definitions> Copy the JDBC driver to a path that can be picked up by BES.standard.

Installation and Setup </New> </Arg> <Arg> <New class="org.jdbc.name=jdbc/LiferayPool datasource.url=jdbc:jtds:sqlserver://localhost/lportal datasource.sourceforge. datasource. OracleAS with SQL Server Create a data source bound to jdbc/LiferayPool.jtds.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="net. and test as the password. create a Tx data source bound to jdbc/LiferayEJB.classname=net.username=test datasource.Driver" url="jdbc:jtds:sqlserver://localhost/lportal" username="test" password="test" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver to /j2ee/home/lib. and set the proper JDBC properties by editing /config/data-sources.properties.enhydra. test as the user name. <data-source class="com.mapper= Copy the JDBC driver for to /lib/ext.xml.Driver as the driver.jdbc.StandardXAPoolDataSource"> <Arg type="Integer">4</Arg> <Set name="MinSize">4</Set> <Set name="MaxSize">15</Set> </New> </Arg> </Call> </New> </Arg> </Call> Copy the JDBC driver for to /lib.sourceforge.evermind. JDBC drivers can be found from the database vendor's web site.Driver datasource. JOnAS with SQL Server Create a data source bound to jdbc/LiferayPool by editing /conf/jonas/liferay-ds.jtds.jtds.sql.sourceforge.jdbc.password=test datasource. JDBC drivers can be found from the database vendor's web site. JDBC drivers can be found from the database vendor's web site.jdbc. net. JRun with SQL Server Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:jtds:sqlserver://localhost/lportal as the URL. 82 .pool.

and set the proper JDBC properties by editing /config/data-sources.jtds.sql.jdbc. If there is a duplicate service.xml. Make sure there isn't another data source bound to jdbc/LiferayPool. undeploy it by removing its xml configuration. and test as the password. <data-source class="com.sourceforge.jtds. Pramati with SQL Server Use the Management Console to do the following: Create a data source bound to jdbc/LiferayPool using jdbc:jtds:sqlserver://localhost/lportal as the URL.Driver"> <url>jdbc:jtds:sqlserver://localhost/lportal</url> <user>test</user> <password>test</password> </driver> <prepared-statement-cache-size>8</prepared-statement-cache-size> <max-connections>20</max-connections> <max-idle-time>30s</max-idle-time> </database> Copy the JDBC driver to /lib. Resin with SQL Server Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /conf/resin. Orion with SQL Server Create a data source bound to jdbc/LiferayPool. Make sure there isn't another data source bound to jdbc/LiferayPool.jdbc.sourceforge.evermind.jtds. undeploy it by removing its xml configuration. JDBC drivers can be found from the database vendor's web site. If there is a duplicate service. net. RexIP with SQL Server 83 . JDBC drivers can be found from the database vendor's web site.Installation and Setup Make sure there isn't already another data source bound to jdbc/LiferayPool.jdbc. undeploy it by removing its xml configuration.conf.Driver as the driver.Driver" url="jdbc:jtds:sqlserver://localhost/lportal" username="test" password="test" inactivity-timeout="30" schema="database-schemas/" /> Copy the JDBC driver for to /lib. create a Tx data source bound to jdbc/LiferayEJB. <database> <jndi-name>jdbc/LiferayPool</jndi-name> <driver type="net.DriverManagerDataSource" name="Liferay" location="jdbc/LiferayCore" pooled-location="jdbc/LiferayPool" xa-location="jdbc/xa/LiferayXA" ejb-location="jdbc/LiferayEJB" connection-driver="net.sourceforge. test as the user name. If there is a duplicate service.

.jdbc.0. <Resource name="jdbc/LiferayPool" auth="Container" type="javax.jtds.DataSource" /> <ResourceParams name="jdbc/LiferayPool"> <parameter> <name>driverClassName</name> <value>net..Installation and Setup Create a data source bound to jdbc/LiferayPool and set the proper JDBC properties by editing /server. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/liferay. Sun JSAS with SQL Server Use the Administration Console to do the following: Create a connection pool org.sourceforge. JDBC drivers can be found from the database vendor's web site.jtds.x. undeploy it by removing its xml configuration. If there is a duplicate service.BasicDataSource as the data source class.jdbc. <datasource name="LiferayPool" jndi-name="jdbc/LiferayPool" driver="net. The pool properties are driverClassName=net. and password=test.xml. Make sure there isn't another data source bound to jdbc/LiferayPool.jdbc.sql.Driver.sourceforge. Create a data source bound to jdbc/LiferayPool.sourceforge.Driver" url="jdbc:jtds:sqlserver://localhost/lportal" username="test" password="test" max-pool="100" transactional="false" /> Copy the JDBC driver to /lib.xml.commons. Tomcat with SQL Server For Tomcat 5.dbcp.apache.> . url=jdbc:jtds:sqlserver://localhost/lportal..Driver</value> </parameter> <parameter> <name>url</name> <value>jdbc:jtds:sqlserver://localhost/lportal</value> </parameter> <parameter> <name>username</name> <value>test</value> </parameter> <parameter> <name>password</name> <value>test</value> </parameter> <parameter> <name>maxActive</name> <value>20</value> </parameter> 84 .. <Context. username=test.jtds.

and your JDBC driver to /AppServer/lib/ext.Driver as the driver. Create a new user-defined JDBC provider.jtds.cpdsadapter.. commons-pool. Create a data source bound to jdbc/LiferayPool. <Context. WebLogic with SQL Server Use the Administration Console to do the following: Create a connection pool using jdbc:jtds:sqlserver://localhost/lportal as the URL.jdbc. copy the JDBC driver to /common/lib. Create a Tx data source bound to jdbc/LiferayEJB.sourceforge.. Copy commons-dbcp.sourceforge.dbcp.jdbc.Driver" url="jdbc:jtds:sqlserver://localhost/lportal" username="test" password="test" maxActive="100" maxIdle="30" maxWait="10000" /> </Context> For Tomcat 5.jdbc. WebSphere with SQL Server Use the Administrative Console: Resources -> JDBC Providers.commons. 85 .> <Resource name="jdbc/LiferayPool" auth="Container" type="javax. This wil automataically upgrade your database. Set org.x.sourceforge. The custom properties are driver=net. Remove any references in the class path. Create a data source bound to jdbc/LiferayPool. Upgrade to new versions of Liferay Liferay provides default upgrade scripts to make it easier to upgrade to new versions of Liferay.jar. Go to the ext/sql directory and run ant build-db.jar.DriverAdapterCPDS as the implementation class name.DataSource" driverClassName="net.0. and password=test.xml. net. url=jdbc:jtds:sqlserver://localhost/lportal.sql.jtds.apache. user=test.Driver. test as the user name.5.5. and test as the password.x.Installation and Setup </ResourceParams> </Context> For Tomcat 5. create a data source bound to jdbc/LiferayPool by editing /conf/Catalina/localhost/ROOT.jtds. Run the upgrade scripts 1.x and 5. JDBC drivers can be found from the database vendor's web site.

Users access their email through an IMAP server.com. the portal maps the user id liferay. and Dovecot+Postfix. you may need to customize the upgrade script according to your implementation.0 See Chapter 4: Theme Building for instructions on upgrading your theme from 3. An example script for Red Hat is included in /mail-ejb/scripts/redhat.properties for your mail server. Expect allows you to add. in the default installation. Access is limited to IMAP so that the portal does not have to be programmed to know where to persist the mail. In this case. Support for integration with Microsoft Exchange and other IMAP servers are planned and will be implemented in the near future. For example.properties.0. deleting a mail server account when a portal account is deleted. The portal EJBs will give abstract commands (add/delete/update user) to the remote mail EJBs to carry out. Washington IMAP+Sendmail 1.1 to 4. Install Sendmail and Expect on your mail server. Upgrading Themes from 3. Regenerate classes If you auto-generated classes using service. Configure /portal-ejb/classes/portal. 2.6. The following instructions assume: 86 .1 to 4. The portal synchronizes with the mail server's user authentication by adding a mail server account when a portal account is added.0. the portal must have privileges to modify and to update the mail server's user database. One possible deployment scenario is to run the mail EJBs on the mail server and run the portal EJBs on the web server.6.Installation and Setup Note: If you have modified Liferay's default tables. delete. and updating a mail server account when a portal account is updated. To do this.1 to the email address test@liferay. Cyrus IMAP+Postfix. The mail EJBs then run the appropriate system commands for the specific mail server and operating system. Another possible deployment scenario is to have the mail EJBs and portal EJBs run on the same machine. you will need to paste in the new version of the DTD and generate your classes again. The portal must also keep track of how email addresses map to certain accounts. This can all be configured by editing portal.xml. the mail server and web server are two different machines. Upgrade scripts are located in the ext/sql/update-* folders.com. 3. Mail Servers Liferay Portal Enterprise can integrate with Washington IMAP+Sendmail. or update users in one command.0.

group name tomcat You are using sendmail for email Portal sendmail users are created under the path /home/liferay/users sendmail is running on PORTAL_HOST # Install expect command apt-get install expect # Give tomcat user a password passwd tomcat #give tomcat user a login shell vi /etc/passwd tomcat:x:500:500::/usr/local/tomcat:/bin/bash # Use sudo to allow tomcat to add users visudo Defaults logfile=/var/log/sudolog Defaults:tomcat timestamp_timeout=-1. Pine. or Netscape \ # Communicator.0 (Bundled with Tomcat) Tomcat is installed at /usr/local/tomcat Tomcat is running under the user named tomcat. /usr/bin/passwd # Enable UW-imap vi /etc/xinet.2.d/imap # default: off # description: The IMAP service allows remote users to access their mail using \ # an IMAP client such as Mutt. service imap { socket_type = stream wait = no user = root 87 . /usr/sbin/userdel. fetchmail. passwd_tries=1 tomcat ALL=/usr/sbin/adduser.Installation and Setup • • • • • • • • • The server envronment is linux The server name is called PORTAL_HOST You are logged in as root The distribution is Liferay Portal Professional 3.

html 88 .imap.liferay.d/init.smtp.host</name> <value>localhost</value> </parameter> <parameter> <name>mail.pop3.properties.transport.d/xinetd restart # Add Tomcat mail/MailSession settings vi /usr/local/tomcat/conf/Catalina/localhost/liferay.Installation and Setup server log_on_success log_on_failure disable } = /usr/sbin/imapd += HOST DURATION += HOST = no # Restart the xinetd deamon /etc/rc.store.host</name> <value>localhost</value> </parameter> <parameter> <name>mail.db chgrp tomcat /etc/mail/virtusertable # Create lucent paths mkdir /usr/local/tomcat/liferay/lucene # Create sendmail users path mkdir /home/liferay mkdir /home/liferay/users chown -R tomcat /home/liferay chgrp -R tomcat /home/liferay chmod -R 660 /home/liferay # Create custom portal properties # see http://www.xml <parameter> <name>mail.protocol</name> <value>imap</value> </parameter> <parameter> <name>mail.protocol</name> <value>smtp</value> </parameter> <parameter> <name>mail.host</name> <value>localhost</value> </parameter> # Make the email mapping table writable by tomcat chmod 664 /etc/mail/virtusertable chmod 664 /etc/mail/virtusertable.com/static/content/portal.

username.update=true mail.replace=true in /common/classes/portal-ext.mx.delete.hook.hook.sendmail.properties # will replace the .size=3072000 mail.add.'s with _'s in userid.replace=true passwords.box.5 send "$password\r" expect eof # Create user add command vi /usr/local/tomcat/bin/autouseradd #!/usr/bin/expect -f # 1st argument is the user id to add.hook. which is required for linux set userid [lindex $argv 0] spawn sudo /usr/sbin/adduser $userid -s /bin/false expect eof 89 .home=/home/liferay/users mail.liferay.sendmail.word=false mail.util.style=mail/ mail.impl=com.size=512000 mail.hook.password=/usr/local/tomcat/bin/autopasswd %1% %2% mail.sendmail.mail. # Note: setting mail.junk-mail.change.audit.username.sendmail.5 send "$password\r" expect "password:"W sleep .user=/usr/local/tomcat/bin/autouserdel %1% mail.dictionary.Installation and Setup vi /usr/local/tomcat/common/classes/portal-ext.trail=root@PORTAL_HOST lucene.SendmailHook mail.warning.user=/usr/local/tomcat/bin/autouseradd %1% mail.attachments.hook.warning.virtusertable=/etc/mail/virtusertable mail.hook.max.size=512000 mail.properties mail.sendmail.dir /usr/local/tomcat/liferay/lucene/ # Create change password command vi /usr/local/tomcat/bin/autopasswd #!/usr/bin/expect -f set password [lindex $argv 1] spawn sudo /usr/bin/passwd [lindex $argv 0] expect -i $spawn_id "password:" sleep .trash.allow.

Network Servers. Development Tools. Install Fedora Core 4 [http://fedora.username. 90 . Deselect all packages groups. Administration Tools. Mail Server. choose to install a custom server. so it never prompts again su tomcat /usr/local/tomcat/bin/autouseradd badusername /usr/local/tomcat/bin/autopasswd badusername asst1453 /usr/local/tomcat/bin/autouserdel badusername exit Cyrus IMAP+Postfix 1. DNS Name Server.'s with _'s in userid. FTP Server. +cyrus-imapd-utils MySQL Database: +mysql-server Development Tools: +expect 2. In Fedora Core 4. they were moved to Extras and you will need to use yum to install these packages. Mail Server: +cyrus-imapd. and System Tools.replace=true in /common/classes/portal-ext. Make sure the following RPMs are also selected. Select the package groups: Text-based Internet. This may take a while even if you have a fast connection.redhat.com/].Installation and Setup # Create user remove command vi /usr/local/tomcat/bin/autouserdel #!/usr/bin/expect -f # 1st argument is the user id to remove # Note: setting mail. For a minimal installation. They were not part of Fedora Core 1 and needed to be compiled manually. MySQL Database. which is required for linux set userid [lindex $argv 0] spawn sudo /usr/sbin/userdel -r $userid expect eof # Set chmod chown chgrp chmod chown chgrp chmod chown chgrp command file permissions 700 /usr/local/tomcat/bin/autopasswd tomcat /usr/local/tomcat/bin/autopasswd tomcat /usr/local/tomcat/bin/autopasswd 700 /usr/local/tomcat/bin/autouseradd tomcat /usr/local/tomcat/bin/autouseradd tomcat /usr/local/tomcat/bin/autouseradd 700 /usr/local/tomcat/bin/autouserdel tomcat /usr/local/tomcat/bin/autouserdel tomcat /usr/local/tomcat/bin/autouserdel # Activate tomcat sudo. The packages cyrus-imapd and cyrus-imapd-utils are only available in Fedora Core 2 and Fedora Core 4. Legacy Software Development.properties # will replace the . Update Fedora.

Replace MECH=shadow with MECH=pam.rpm Turn on Cyrus IMAP.1. Turn on Cyrus SASL.6-1.org/official/2. Edit /etc/sysconfig/saslauthd. rpm -i cyrus-imapd-2.16-6.16-6.ch/pub/packages/cyrus-imapd/2.1.16-6.rpm].Installation and Setup rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora yum list yum upgrade 3.1. Turn off Sendmail.src. chkconfig --level 3 saslauthd on /etc/rc.1.1/SRPMS/postfix-2.1/cyrus-imapd-2.i386.i386. If you are using Fedora Core 2 or later.d/init.d/saslauthd start 5. download cyrusimapd-2.1. If you are using Fedora Core 1 or an earlier version of Red Hat.d/sendmail stop 4. chkconfig --level 3 cyrus-imapd on /etc/rc.src.src.src. rpmbuild --rebuild cyrus-imapd-2. you can use the RPMs from Fedora: cyrusimapd and cyrus-imapd-utils. Download the source distribution of Postfix [http://ftp.1.6-1.16-6. Install Postfix with support for MySQL and Cyrus SASL. rpm -ivh postfix-2.wl0.rpm rpm -i cyrus-imapd-utils-2.rpm [http://www.src.rpm Install Cyrus IMAP.d/init.16-6. Download Cyrus IMAP.d/init. chkconfig --level 3 sendmail off /etc/rc.1. Build Cyrus IMAP.rpm cd /usr/src/redhat/SOURCES bash export POSTFIX_MYSQL_REDHAT=1 export POSTFIX_SASL=2 91 .rpm] and build the RPM for your environment from the source distribution.invoca.d/cyrus-imapd start 6.

fc4.cf. Install PAM MySQL. Add these lines: # # Custom Settings # mynetworks = 127.0/16. Transform /etc/postfix/virtual to a format Postfix can read.0/8. 128.12.com anything for each virtual domain that Postfix will manage. A correspending entry is needed in the MySQL database so that email to postmaster@yourdomain.spec exit cd /usr/src/redhat/SPECS rpmbuild -ba postfix.src.135.i386.com can be delivered to a Cyrus IMAP account.rpm cd /usr/src/redhat/SPECS rpmbuild -ba pam_mysql.cf to /etc/postfix/mysql_virtual.0. Add the line yourdomain.7/32 mailbox_command = /usr/bin/procmail -t -a "$EXTENSION" mailbox_transport = procmail 92 .cf. Replace the two instances of /cyrus/bin/deliver with / usr/lib/cyrus-imapd/deliver.Installation and Setup export POSTFIX_TLS=1 sh make-postfix.5-0.spec cd /usr/src/redhat/RPMS/i386 rpm -i --force postfix-2.invoca.spec cd /usr/src/redhat/RPMS/i386 rpm -i pam_mysql-0.rpm 7.5-0. Copy /mail-ejb/scripts/fedora/cyrus/mysql_virtual.rpm 8.sasl2.mysql.6-1. Download the source distribution of PAM MySQL [http://www.0. rpm -ivh pam_mysql-0. Add these two lines: procmail unix n n pipe flags=R user=cyrus argv=/usr/bin/procmail -t -m USER=${user} EXTENSION=${extension} /home/cyrus/procmailrc Edit /etc/postfix/main.0.i386.cf.ch/pub/packages/cyrus-imapd/contrib/pam_mysql-0.5-0.src.tls. postmap /etc/postfix/virtual Edit /etc/postfix/master.cf to point to your MySQL database.168. Modify mysql_virtual.rpm].1. Edit /etc/postfix/virtual. 192.

Note If you copy cyrus_adduser and cyrus_userdel from a Windows environment to a Linux environment. Edit cyrus_adduser and replace localhost with the mail server's host name.0.0. chown cyrus:mail /home/cyrus chown cyrus:mail /home/cyrus/procmailrc.so user=dbuser passwd=dbpassword host=127.d/pop so that POP authentication is checked via MySQL. Turn on Postfix. chmod u+x /usr/bin/cyrus_userdel. 10.0. chkconfig --level 3 postfix on /etc/rc.so user=dbuser passwd=dbpassword host=127.so user=dbuser passwd=dbpassword host=127.0.cf smtpd_recipient_restrictions = permit_mynetworks. Make sure the script can be executed. Make sure the cyrus user can access the script.1 db=cyrus 93 . Copy /mail-ejb/scripts/fedora/cyrus/cyrus_userdel to /usr/bin/cyrus_userdel. Remove the current lines and add these lines: #%PAM-1.d/postfix start 9. Remove the current lines and add these lines: #%PAM-1. Edit /etc/pam.d/imap so that IMAP authentication is checked via MySQL.0. Make sure the script can be executed.0.1 db=cyrus table=CyrusUser usercolumn=userId passwdcolumn=password_ crypt=0 account required pam_mysql.0 auth sufficient pam_mysql. mysql:/etc/postfix/mysql_virtual.0 auth sufficient pam_mysql. Copy /mail-ejb/scripts/fedora/cyrus/procmailrc to /home/cyrus/procmailrc. you need to run dos2unix cyrus_adduser to convert the file so that Linux can read the file correctly.d/init. check_client_access hash:/etc/postfix/pop-before-smtp.1 db=cyrus table=CyrusUser usercolumn=userId passwdcolumn=password_ crypt=0 account required pam_mysql. Edit cyrus_userdel and replace localhost with the mail server's host name.1 db=cyrus table=CyrusUser usercolumn=userId passwdcolumn=password_ crypt=0 Edit /etc/pam.0. Copy /mail-ejb/scripts/fedora/cyrus/cyrus_adduser to /usr/bin/cyrus_adduser.so user=dbuser passwd=dbpassword host=127. chmod u+x /usr/bin/cyrus_adduser.0. check_relay_domains Set mynetworks to the IPs that are allowed to connect to Postfix.Installation and Setup virtual_maps = hash:/etc/postfix/virtual.

use cyrus.fce. use mysql.0.blogs@yourdomain. "Y". quit. "Y". password("dbpassword").d/spamassassin start 13. "Y". 'your_domain_1'). The Expect scripts cyrus_adduser and cyrus_userdel that are used to add and delete Cyrus IMAP users require a default cyrus user to authenticate with. Install ClamAV. 94 . password_) values ('your_domain_1'.Installation and Setup table=CyrusUser usercolumn=userId passwdcolumn=password_ crypt=0 11. "Y".vutbr. 'cyrus_password'). 'your_password'). Create a default account for your_domain_1.d/init. "dbuser". insert into CyrusUser (userId. insert into user values ('127.1-1.d/init. Download ClamAV [http://crash.com entry so that email to postmaster@yourdomain.cz/crash-hat/3/clamav/clamav-0. insert into CyrusVirtual (emailAddress. "Y".i386.0. Create the database and tables that will be used to authenticate IMAP users. insert into CyrusVirtual (emailAddress.86. cyrus_adduser cyrus_password your_domain_1 12. "Y"). "Y". "Y". create table CyrusUser ( userId varchar(75) not null primary key. password_) values ('cyrus'. insert into CyrusUser (userId. "Y". userId) values ('postmaster@yourdomain.com'. chkconfig --level 3 spamassassin on /etc/rc. "Y". "Y".com'. userId) values ('joe. 'your_domain_1'). create table CyrusVirtual ( emailAddress varchar(75) not null primary key. "Y". Turn on SpamAssassin. password_ varchar(75) not null ).rpm].d/mysqld start Configure MySQL so that it can be accessed by the username dbuser and password dbpassword. create database cyrus.1'.com can be delivered to a Cyrus IMAP account. "Y". Turn on MySQL. userId varchar(75) not null ). "Y". chkconfig --level 3 mysqld on /etc/rc. Every virtual domain requires a postmaster@yourdomain.

2.d/init.52.dotconf.tar.2 .rpm Turn on ClamAV.2. chkconfig --level 3 clamd on /etc/rc.tar. gunzip sendEmail-v1.com/clamassassin/clamassassin-1.gz].2. 95 .tar cd clamassassin-1.tar.2. Install ClamAssassin. Copy /mail-ejb/scripts/fedora/cyrus/procmail_vacation to /usr/local/bin/procmail_vacation.1-1. Pop-before-smtp requires perl-TimeDate and perl-Net-Netmask. 14. chmod u+x /usr/local/bin/procmail_vacation.52. Install perl-Net-Netmask.2.i386.52.gz tar xvf clamassassin-1. Download SendEmail [http://caspian.tar cd sendEmail-v1.net/projects/popbsmtp].gz tar xvf sendEmail-v1.net/menu/Software/SendEmail/sendEmail-v1./configure cp clamassassin /usr/local/bin Edit /usr/local/bin/clamassassin.86.Installation and Setup rpm -i clamav-0.d/clamd start Download ClamAssassin [http://drivel. gunzip clamassassin-1. Make sure the script can be executed.2.gz]. Set SUBJECTHEAD to "[VIRUS] ".52 chmod u+x sendEmail chown cyrus:mail sendEmail cp sendEmail /usr/local/bin 15. Download the source distribution of Pop-before-smtp [http://sourceforge. Install perl-TimeDate from the distributed RPM.2.tar. Install SendEmail. perl -MCPAN -e 'install Net::Netmask' Install Pop-before-smtp.

$dbfile = '/etc/postfix/pop-before-smtp'.d/pop-before-smtp start 16.impl=com.) \S+ (?:pop3d|imapd)\[\d+\]: ' . It supports an interactive command line interface for testing: mailadmin. shutdown -r now Dovecot+Postfix First build a generic Liferay email hook.box.tar cd pop-before-smtp-1.38.style=INBOX We next built a generic Korn Shell Script. . You install it by adding these lines to portal-ext.util. that shells out all of the email methods.gz tar xvf pop-before-smtp-1.hook.ksh addForward [userId] [emailAddresses] mailadmin..mail.38 chown root:root * cp pop-before-smtp. $grace = 120*60.:.d/init.38.ksh addUser [userId] [password] [firstName] [middleName] [lastName] 96 .ksh.hook.liferay.pl by uncommenting and modifying certain sections so it matches the following information..java. mailadmin. $file_tail{'name'} = '/var/log/maillog'.d/pop-before-smtp cp pop-before-smtp /usr/sbin/ cp pop-before-smtp-conf.tar. # Set the log file we will watch for pop3d/imapd records.init /etc/rc..properties: mail. that implements each method for Dovecot.:. Turn on Pop-before-smtp.Installation and Setup gunzip pop-before-smtp-1.ksh mailadmin. or any other email system you want. ... chkconfig --level 3 pop-before-smtp on /etc/rc.script=/usr/sbin/mailadmin. Restart your mail server.ShellHook mail.ksh mail. # For Cyrus (including a tweak for IP addrs that don't resolve): $pat = '^(.ksh --help mailadmin.shell.pl /etc Edit /etc/pop-before-smtp-conf..d/init. ShellHook.

"mail".ksh updateEmailAddress [userId] [emailAddress] mailadmin.0. old_password("DBPASSWD").ksh Here are the step-by-step installation instructions: # Edit SASL-auth authentication to use MySQL with the Postfix setup vi /etc/pam.ksh deleteEmailAddress [userId] mailadmin. "Y". "Y".ksh deleteUser [userId] mailadmin. "Y".0.ksh addVacationMessage [userId] [emailAddress] [vacationMessage] mailadmin. and postfix tables 97 . "Y". "Y".d/smtp #%PAM-1. commit.0. "Y". is inserted into the postfix_users table below vi /etc/group tomcat:x:500:vmail vmail:x:510:tomcat # CONFIGURE MYSQL # Add DBUSR to MySql database for managing email tables mysql -u root -p use mysql.ksh updateBlocked [userId] [blockedEmailAddress] mailadmin. "Y").0 auth sufficient pam_mysql.0.1'.0. "DBUSR". "Y".0.ksh updatePassword [userId] [password] All of the code is in SVN. "Y". "Y". "Y". quit # Login as email user and build email database.so user=DBUSR passwd=DBPASSWD host=127. insert into user values ('127.1 db=mail table=postfix_users usercolumn=email passwdcolumn=clear crypt=0 account required pam_mysql.Installation and Setup [emailAddress] mailadmin.1 db=mail table=postfix_users usercolumn=email passwdcolumn=clear crypt=0 # CONFIGURE VMAIL USER AND EMAIL PATHS groupadd useradd mkdir -p chown -R chmod -R -g 510 vmail -u 510 -g vmail vmail /var/vmail/EMAILDOMAIN vmail:vmail /var/vmail 770 /var/vmail # Add vmail user to tomcat group and tomcat user to vmail group # Note the vmail uid. "Y". mailadmin is at: mail-ejb/scripts/fedora/ksh/mailadmin. "Y".so user=DBUSR passwd=DBPASSWD host=127. "Y". 510.

'sender'. PRIMARY KEY (id) ) TYPE=MyISAM. type enum('recipient'. crypt varchar(128) NOT NULL default ''.'virtual:'). gid int(11) unsigned NOT NULL default '1004'. name tinytext NOT NULL. domain varchar(128) NOT NULL default ''. quota tinytext NOT NULL. UNIQUE KEY domain (domain) ) TYPE=MyISAM. destination varchar(128) NOT NULL default ''. uid int(11) unsigned NOT NULL default '1004'.'N') NOT NULL default 'Y'. CREATE TABLE postfix_transport ( id int(11) unsigned NOT NULL auto_increment. CREATE TABLE postfix_access ( id int(10) unsigned NOT NULL auto_increment. CREATE TABLE postfix_alias ( id int(11) unsigned NOT NULL auto_increment. access enum('Y'. PRIMARY KEY (id). source varchar(128) NOT NULL default ''. CREATE TABLE postfix_relocated ( id int(11) unsigned NOT NULL auto_increment. # Add an email domain INSERT INTO `postfix_transport` VALUES (3. homedir tinytext NOT NULL. PRIMARY KEY (id).'EMAILDOMAIN'. maildir tinytext NOT NULL. email varchar(128) NOT NULL default ''. PRIMARY KEY (id) ) TYPE=MyISAM.'N') NOT NULL default 'Y'. email varchar(128) NOT NULL default ''. destination varchar(128) NOT NULL default ''. 98 . postfix enum('Y'. PRIMARY KEY (id) ) TYPE=MyISAM. clear varchar(128) NOT NULL default ''. destination varchar(128) NOT NULL default ''. CREATE TABLE postfix_users ( id int(11) unsigned NOT NULL auto_increment. email varchar(128) NOT NULL default ''. access varchar(128) NOT NULL default ''.'client') NOT NULL default 'recipient'. PRIMARY KEY (id) ) TYPE=MyISAM commit. destination varchar(128) NOT NULL default ''. CREATE TABLE postfix_virtual ( id int(11) unsigned NOT NULL auto_increment. use mail.Installation and Setup mysql -u DBUSR -p create database mail. alias varchar(128) NOT NULL default ''. UNIQUE KEY email (email) ) TYPE=MyISAM.

Installation and Setup # Add an email user (automated by Liferay using ShellHook.'LIFERAYUSR@EMAILDOMAIN'.0. commit.1 99 .0.0. quit # CONFIGURE POSTFIX cd /etc/postfix/ rm -rf ssl/ rm -rf sasl/ vi /etc/postfix/mysql-aliases.''.cf user = DBUSR password = DBPASSWD dbname = mail table = postfix_access select_field = access where_field = source additional_conditions = and type = 'client' hosts = 127.cf user = DBUSR password = DBPASSWD dbname = mail table = postfix_relocated select_field = destination where_field = email hosts = 127.0.cf user = DBUSR password = DBPASSWD dbname = mail table = postfix_alias select_field = destination where_field = alias hosts = 127.0. and mailadmin.0.cf user = DBUSR password = DBPASSWD dbname = mail table = postfix_access select_field = access where_field = source additional_conditions = and type = 'recipient' hosts = 127.'EMAILDOMAIN/LIFERAYUS # Add an email forward INSERT INTO `postfix_virtual` VALUES (27.1 vi /etc/postfix/mysql-recipient.ksh) # vmail uid is 510 INSERT INTO `postfix_users` VALUES (17.1 vi /etc/postfix/mysql-client.510.'LIFERAYUSR@EMAILDOMAIN').'LIFERAYPWD'.510.0.'/var/vmail'.0.1 vi /etc/postfix/mysql-relocated.'LIFERAYLOGIN'.''.

1 vi /etc/postfix/mysql-virtual-uid.cf user = DBUSR password = DBPASSWD dbname = mail table = postfix_users select_field = uid where_field = email additional_conditions = and postfix = 'y' hosts = 127.1 vi /etc/postfix/mysql-virtual.0.1 vi /etc/postfix/mysql-transport.0.0.0.1 chmod 640 /etc/postfix/mysql-* chown root:postfix /etc/postfix/mysql-* vi /etc/postfix/main.Installation and Setup vi /etc/postfix/mysql-sender.cf user = DBUSR password = DBPASSWD dbname = mail table = postfix_transport select_field = destination where_field = domain hosts = 127.cf user = DBUSR password = DBPASSWD dbname = mail table = postfix_users select_field = maildir where_field = email additional_conditions = and postfix = 'y' hosts = 127.cf user = DBUSR password = DBPASSWD dbname = mail table = postfix_virtual select_field = destination where_field = email hosts = 127.0.0.cf 100 .0.0.0.cf user = DBUSR password = DBPASSWD dbname = mail table = postfix_access select_field = access where_field = source additional_conditions = and type = 'sender' hosts = 127.0.cf user = DBUSR password = DBPASSWD dbname = mail table = postfix_users select_field = gid where_field = email additional_conditions = and postfix = 'y' hosts = 127.1 vi /etc/postfix/mysql-virtual-gid.1 vi /etc/postfix/mysql-virtual-maps.0.0.

permit smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-sender.cf smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-client.cf relocated_maps = mysql:/etc/postfix/mysql-relocated.cf local_recipient_maps = $alias_maps $virtual_mailbox_maps chmod 644 chown root:root /etc/postfix/main. command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix program_directory = /usr/libexec/postfix smtpd_banner = $myhostname ESMTP $mail_name setgid_group = postdrop biff = no append_dot_mydomain = no myhostname = EMAILDOMAIN myorigin = $myhostname mydestination = EMAILDOMAIN.cf vi /etc/postfix/master.cf.cf.0/8 mailbox_command = mailbox_size_limit = 0 recipient_delimiter = + smtpd_sasl_auth_enable = yes smtpd_recipient_restrictions = permit_sasl_authenticated. check_recipient_access mysql:/etc/postfix/mysql-recipient. fuller version of this file. reject_unauth_destination.0. # Do not change these directory settings .dist for a commented.cf virtual_maps = mysql:/etc/postfix/mysql-virtual. $transport_maps relayhost = mynetworks = 127.0.cf /etc/postfix/main. reject_unauth_destination smtpd_sasl_security_options = noanonymous smtpd_sasl_local_domain = $myhostname broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_mynetworks.cf virtual_gid_maps = mysql:/etc/postfix/mysql-virtual-gid. permit_sasl_authenticated.cf virtual_uid_maps = mysql:/etc/postfix/mysql-virtual-uid.they are critical to Postfix operation. permit_mynetworks.cf transport_maps = mysql:/etc/postfix/mysql-transport.cf alias_maps = mysql:/etc/postfix/mysql-aliases.cf smtp inet n pickup fifo n cleanup unix n qmgr fifo n rewrite unix bounce unix defer unix trace unix verify unix flush unix n proxymap unix smtp unix relay unix showq unix n - n n n n n n n n n n n n n n 60 300 1000? 101 1 0 1 0 0 0 1 0 - smtpd pickup cleanup qmgr trivial-rewrite bounce bounce bounce verify flush proxymap smtp smtp showq .Installation and Setup # see /usr/share/postfix/main.cf virtual_mailbox_base = /var/vmail virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.

99. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient procmail unix n n pipe flags=R user=cyrus argv=/usr/bin/procmail -t -m USER=${user} EXTENSION=${extension} /home/cyrus/procmailrc chmod 644 /etc/postfix/master.conf protocols = imaps pop3s imap pop3 ssl_disable = yes ssl_cert_file = /etc/ssl/certs/dovecot.el3.cf chown root:root /etc/postfix/master.13-1.cf # CONFIGURE DOVECOT cd wget http://dag.pem ssl_key_file = /etc/ssl/private/dovecot.rf.pem login = imap login_executable = /usr/libexec/dovecot/imap-login login = pop3 login_executable = /usr/libexec/dovecot/pop3-login mail_extra_groups = mail default_mail_env = maildir:/var/vmail/%d/%n/Maildir imap_executable = /usr/libexec/dovecot/imap pop3_executable = /usr/libexec/dovecot/pop3 auth = default auth_mechanisms = plain auth_default_realm = EMAILDOMAIN auth_userdb = mysql /etc/dovecot-mysql.wieers.99.rpm apt-get install rh-postgresql-libs rpm -Uvh dovecot-0.i386.el3.1.1.postfix ($recipient) ifmail unix n n pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) bsmtp unix n n pipe flags=Fq.rpm vi /etc/dovecot.conf auth_passdb = mysql /etc/dovecot-mysql.Installation and Setup error unix n error local unix n n local virtual unix n n virtual lmtp unix n lmtp anvil unix n 1 anvil maildrop unix n n pipe flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient} old-cyrus unix n n pipe flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user} cyrus unix n n pipe user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user} uucp unix n n pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender .$nexthop!rmail.rf.i386.conf auth_user = root auth_verbose = yes 102 .com/packages/dovecot/dovecot-0.13-1.

ksh cp mailadmin.mail.portal.ksh chown tomcat:tomcat /usr/sbin/mailadmin.class /usr/local/tomcat/common/lib/ext/portal-ejb.script=/usr/sbin/mailadmin.box.host</name> <value>localhost</value> 103 .jar -> update com.log chown tomcat:tomcat /var/log/mailadmin.host</name> <value>localhost</value> </parameter> <parameter> <name>mail.hook.0.0.ksh DOMAIN=EMAILDOMAIN MYSQL_USERNAME=DBUSR MYSQL_PASSWORD=DBPASSWD TOMCAT_UID=500 VMAIL_GID=510 # Domain being managed # MySQL user # MySQL password # Mail File Creation user id .ShellHook.ksh # create mailadmin log file touch /var/log/mailadmin.StringUtil.log # configure liferay to use mailadmin. uid.Installation and Setup vi /etc/dovecot-mysql.util.log chmod 660 /var/log/mailadmin.util.util.ksh vi /usr/local/tomcat/common/classes/portal-ext. gid FROM postfix_users WHERE email = '%n@%d' or email = '%n@EMAILDOMAIN' # CONFIGURE LIFERAY # configure mailadmin.vmail chmod 750 /usr/sbin/mailadmin.impl=com.jar -> add com.conf db_host = 127.liferay.ksh mail.properties mail.class # Configure Tomcat #add mail/MailSession settings vi /usr/local/tomcat/conf/Catalina/localhost/liferay.ShellHook mail.class /usr/local/tomcat/common/lib/ext/portal-ejb.1 db_port = 3306 db = mail db_user = DBUSR db_passwd = DBPASSWD db_client_flags = 0 default_pass_scheme = PLAIN password_query = SELECT clear FROM postfix_users WHERE email = '%n@%d' or email = '%n@EMAILDOMAIN' user_query = SELECT maildir.liferay.PropsUtil.jar -> update com.ksh /usr/sbin vi /usr/sbin/mailadmin.mail.liferay.style=INBOX # update these JARs with latest from SVN HEAD /usr/local/tomcat/common/lib/ext/mail-ejb.shell.util.xml <parameter> <name>mail.tomcat # Mail File Creation group id .imap.liferay.smtp.hook.

host</name> <value>localhost</value> </parameter> # Enable autostart on reboots chkconfig postfix on chkconfig dovecot on # Verify Install Commands tail -f 50 /var/log/maillog tail -f 50 /var/log/messages # Restart saslauthd before Postfix.Installation and Setup </parameter> <parameter> <name>mail.d/dovecot restart ps -ef | grep dovecot | grep -v grep reboot # make ps -ef ps -ef ps -ef sure everything starts | grep postfix | grep -v grep | grep dovecot | grep -v grep | grep saslauthd | grep -v grep 104 .protocol</name> <value>imap</value> </parameter> <parameter> <name>mail.protocol</name> <value>smtp</value> </parameter> <parameter> <name>mail.d/saslauthd restart # make sure saslauthd restarts ps -ef | grep saslauthd | grep -v grep # make sure postfix restarts /etc/init.store.d/postfix restart ps -ef | grep postfix | grep -v grep # make sure dovecot restarts /etc/init.transport.pop3. otherwise it doesn't answer smtp requests /etc/init. so that Postfix doesn't start with # a bad SASL setup.

quit #TEST IMAP by logging in as LIFERAYUSR@EMAILDOMAIN telnet localhost imap x LOGIN LIFERAYUSR@EMAILDOMAIN LIFERAYPWD x STATUS "INBOX" (MESSAGES) x SELECT "INBOX" x FETCH 1 BODY[HEADER] x LOGOUT # Test using usedId without a Domain name telnet localhost imap x LOGIN LIFERAYUSR LIFERAYPWD x STATUS "INBOX" (MESSAGES) x SELECT "INBOX" x FETCH 1 BODY[HEADER] x LOGOUT Microsoft Exchange Coming soon. 105 .ccuc..com RCPT TO:LIFERAYLOGIN DATA Test msg .net.liferay.com.. Users in each of these portals have no information about the other portals. Multiple Portal Instances Liferay was built from the ground up to be used by application service providers. http://my. They are separated by domain and each portal exists in its own space based on the company's id.Installation and Setup # Test SMTP by sending an email to LIFERAYUSR@EMAILDOMAIN telnet localhost 25 EHLO EMAILDOMAIN MAIL FROM:test@test. quit # Test SMTP by sending an email to alias LIFERAYLOGIN telnet localhost 25 EHLO EMAILDOMAIN MAIL FROM:test@test.3sixteen.net. http://www. http://my.com.com RCPT TO:LIFERAYUSR@EMAILDOMAIN DATA Test msg .jasonandiris.gatewayfriends. http://www. The following is a sample list of portals running off of one portal instance hitting one database and shows the capabilities of Liferay: http://demo.org.

ear/portal-web-alpha.0.war/WEB-INF/jboss-web. 5.com as the login and test as the password.ear/portal-web-alpha.ear/META-INF/application.. <context-param> <param-name>company_id</param-name> <param-value>alpha.com.war.war.war and portal-web-beta.beta.xml to add the context root and virtual host.war to portal-web-alpha.. 4. the portal will create the necessary database entries and create a default user account with test@alpha.com.0. Repeat this step for /server/default/deploy/ext.ear/portal-web-complete.alpha.com</param-value> </context-param> On startup. This will help in testing the setup. <jboss-web> <security-domain>java:/jaas/PortalRealm</security-domain> <context-root>/</context-root> <virtual-host>www.com with beta.xml.Installation and Setup JBoss+Jetty Coming soon. Remove the old reference to portal-web-complete. 6.ear/portal-web-beta.com and www.xml but replace alpha.0.. Edit /server/default/deploy/ext.com 127. JBoss+Tomcat 1. Edit /server/default/deploy/ext.beta. Install JBoss+Tomcat.1 www.com 2.0. 127.xml but replace alpha. 3. Edit C:\Windows\system32\drivers\etc\hosts so that www.com with beta.. </jboss-web> Repeat this step for /server/default/deploy/ext. Rename /server/default/deploy/ext.xml and change the value of the company id to alpha.ear/portal-web-beta.1 www.war.war</web-uri> 106 .war to portal-web-beta.com.war/WEB-INF/web.com resolve to your local machine.war and add the references to portal-web-alpha.alpha. <module> <web> <web-uri>portal-web-alpha.alpha. Copy /server/default/deploy/ext.war/WEB-INF/web.ear/portal-web-alpha.war/WEB-INF/jboss-web.com</virtual-host> . Edit /server/default/deploy/ext.

. .. you can have a mini WAR that contains the basic XML information and have it reference the larger portal-web.com 127.. Instead of copying the entire portal-web-complete.beta.com resolve to your local machine.web" defaultHost="www.alpha..0.com and http://www..com"> 107 2.com. <Host name="www.com/test. Orion 1. 127.xml and add entries for alpha.0.com 3..beta.com and beta. The instructions for Orion will not make sense unless you are developing from the source.sar/server.war (several megs) for each portal instance.. The steps for Orion are more complicated because Orion allows you to share two servlet WARs. 4..war.xml to add the alpha and beta hosts.alpha. This will help in testing the setup.alpha.1 www. Edit /server/default/deploy/jbossweb-tomcat50. <Engine name="jboss.beta.com/test and test@beta.war</web-uri> <context-root>/</context-root> </web> </module> 7. Install Orion with the instructions for your Development Environment [???]. Jetty Coming soon. .alpha. <DefaultContext cookies="true" crossContext="true" override="true" /> </Host> <Host name="www.com.alpha.com" .com" . Your user login and password combinations are test@alpha.. Edit C:\Windows\system32\drivers\etc\hosts so that www...1 www. ..0.com and www.beta.Installation and Setup <context-root>/</context-root> </web> </module> <module> <web> <web-uri>portal-web-beta. <web-site id="alpha. Edit /portal/web-sites/web-sites. <DefaultContext cookies="true" crossContext="true" override="true" /> </Host> </Engine> 8.com"> .0. Start JBoss+Tomcat and access the portals with your browser at http://www.

.com with beta./.com..com/test. Repeat this step for /orion/config/web-sites/beta. Tomcat Coming soon.xml. Start Orion and access the portals with your browser at http://www.com. Run ant clean start deploy from /portal.xml but replace alpha.. <web-module id="alpha. Your user login and password combinations are test@alpha..xml and add entries for alpha. 9.com"> <default-web-app application="default" name="alpha. Edit /orion/config/server.com. <web-site path=".xml" /> 8.com and beta. 108 ./web-sites/beta..alpha. <web-site virtual-hosts="www.com as the login and test as the password. the portal will create the necessary database entries and create a default user account with test@alpha.com-web./applications/alpha..com-web.beta.com-web-access.com-web.xml" /> <web-site path=".log" /> </web-site> On startup.com-web" path=".com-web" path="./log/alpha.war" /> <web-module id="beta.alpha.com-web.com/test and test@beta.com and beta./applications/beta.xml and add entries for alpha. Edit /orion/config/application.com.com-web. Create /orion/config/web-sites/alpha./web-sites/alpha.com and http://www. 6.com-web" load-on-startup="true" /> <web-app application="default" name="portal-web" root="/portal" load-on-startup="true" /> <access-log path=".war" /> 7.com-web.Installation and Setup <forward-url>/c</forward-url> </web-site> <web-site id="beta.com"> <forward-url>/c</forward-url> </web-site> 5.

Download and unzip the source to /portal. 2. /ext 1. /ext/ext-web. You should see the following directories: /ext/downloads. This takes a few minutes and should only be used when deploying to a production server. Run ant install-jonas-jetty under /ext/servers to install JOnAS+Jetty to /ext/servers/jonas-jetty. 4.server.name}.0. /ext/portlets.sourceforge.properties and set jsp.0.net/lportal/liferay-portal-jetty-4.properties.${user. /ext/ext-ejb. and WebLogic and have not yet been made available for the other supported application servers. From there. JBoss+Tomcat. The Ant scripts referred to by these instructions are only available for JBoss+Jetty.zip to /ext/downloads. Run ant install-jboss-jetty under /ext/servers to install JBoss+Jetty to /ext/servers/jboss-jetty. Download liferay-portal-ent-4. Read /ext/readme. 2.server. Download liferay-portal-ent-4. Follow the instructions found in Development Environment if you want to modify the actual source and contribute your changes back to the project. RexIP. /ext/sql. Download liferay-portal-ent-4.0.type to use other application servers. 3.zip [http://prdownloads. / ext/lib.name}. /ext/ext-lib.properties where ${user.sourceforge. Copy /ext/build.server.0-jetty.net/lportal/liferay-portal-jonas-jetty-4.properties to /ext/build.${user.zip?download] to /ext/downloads. OracleAS.type=jboss-jetty to use JBoss/Jetty as your application server.properties where ${user. Run ant install-jetty under /ext/servers to install Jetty to /ext/servers/jetty.name} is the user name you used to log into your operating system.0. Download liferay-portal-pro-4.0. Then type ant build-ext to create /ext which is your extension environment.server. 109 .0-jboss-tomcat. Orion. /ext/servers.properties and set app.0. and /ext/web-sites.Chapter 3.net/lportal/liferay-portal-jboss-jetty-4.zip?download] to /ext/downloads. Customizing the Portal The following instructions are for those who wish to customize the portal with their own portlets that will not be given back to the general public. /ext/ext-ear.${user.zip?download] to /ext/downloads.name}. These instructions are meant to keep custom code separated from the Liferay code so that upgrades can be made easily. Edit /ext/build. Edit /ext/app.0. The location of /ext is configured in /portal/release.${user.sourceforge. Run ant install-jboss-tomcat under /ext/servers to install JBoss+Tomcat to /ext/servers/jboss-tomcat.txt for basic instructions on how to deploy the extension EAR on the various application servers.zip [http://prdownloads. You can modify the value of app. Copy /ext/app.0-jboss-jetty. type ant start.server.name}.properties to /ext/app.0.0.0-jonas-jetty.0. /ext/downloads 1.name} is the user name you used to log into your operating system.zip [http://prdownloads.precompile=on to precopmile JSPs for JBoss+Jetty or JBoss+Tomcat.

Run ant deploy from /ext/ext-ear to deploy your custom EAR to your specified application server (see / ext/app.zip] to / ext/downloads. 2. Run ant install-oc4j under /ext/servers to install OracleAS to /ext/servers/oc4j.0.net/lportal/liferay-portal-jonas-tomcat-4.properties.server. See Properties and Languages.com/mirrordownload.0.Customizing the Portal 5.zip [http://prdownloads.sourceforge.sourceforge.0. Run ant install-orion under /ext/servers to install Orion to /ext/servers/orion. /ext/ext-ear 1.zip?download] to /ext/downloads if you are using Java 1.0. This allows you to easily upgrade Liferay because all the functionality is packed into archives. Important files in this directory are /ext/ext-ejb/classes/portal-ext.0.0.0.properties.com/] to /ext/downloads.zip [http://www.net/lportal/liferay-portal-tomcat-4.zip [http://www. Download oc4j_extended.7 .properties).6. /ext/ext-web 110 .0-jonas-tomcat.0.oracle.properties.orionserver. 2. Download orion2.sourceforge.net/lportal/liferay-portal-tomcat-jdk5-4. Place any extra dependent libraries in here. / ext/ext-ejb/classes/system-ext.zip [http://prdownloads. If you are using Java 1.4 Download liferay-portal-tomcat-4. Run ant deploy from /ext/ext-ejb to compile your source and to deploy your classes to the expanded EAR in your specified application server's deployment directory. and /ext/ext-ejb/classes/content/Language-ext.zip?download] to /ext/downloads. Download liferay-portal-ent-4.5. 8.0.0.0.0.zip [http://prdownloads. They will be copied over to the deployment directory when you run ant deploy from /ext. 6. Your custom EAR utilizes the Liferay JARs and WARs contained in /ext/ext-ear/modules.0. Download liferay-portal-tomcat-jdk5-4. Run ant install-jonas-tomcat under /ext/servers to install JOnAS+Tomcat to /ext/servers/jonas-tomcat. 7. /ext/ext-lib 1.jsp?file=orion2.zip?download] Run ant install-tomcat under /ext/servers to install Tomcat to /ext/servers/tomcat. /ext/ext-ejb 1.

xml.xml.html forwards the user to http://localhost/c/extranet/home. edit /ext/ext-web/docroot/WEB-INF/portlet-ext. You can hot deploy portlets by putting WAR files in this directory. These *-ext. This provides an easy way to extend the portal without changing the source and makes upgrading very easy. the script will unjar /ext/ext-ear/modules/portal-web. /ext/portlets 1. 111 . /ext/web-sites/liferay. See Portlet Examples for information on general portlet design. There are also two files named test. To add a portlet.properties and test. By default. /ext/ext-web/docroot/WEB-INF/liferay-display.com-web/docroot/index.Customizing the Portal 1.txt. /ext/web-sites 1.xml files are read after their parent files are read and override their parent values. See the section called Databases.properties. If /ext/ext-web/tmp does not exist. / ext/ext-web/docroot/WEB-INF/liferay-portlet-ext. The script will then copy everything from /ext/ext-web/docroot over to /ext/ext-web/tmp and then copy everything from /ext/ext-web/tmp to the deployment directory of your specified application server. 2. /ext/servers 1.xml. You can replace this file to pretty up the default page or change the default behavior.script that are copied over to your specified application server's bin directory when you run ant deploy from /ext. and /ext/ext-ejb/classes/content/Language-ext. All the files in /ext/web-sites/liferay. /ext/sql 1. They will be copied over to the deployment directory when you run ant deploy from /ext.war into / ext/ext-web/tmp. See Hot Deploy for more information. See the section on /ext/downloads and read /ext/readme. The two files are used by Hypersonic and contain a snapshot of the portal's default data.com-web/docroot are copied to the deployment directory when you run ant deploy from /ext or /ext/ext-web. This directory contains all of the portal's database scripts. /ext/lib 1. Run ant deploy from /ext/ext-web. This directory contains all of the portal's deployment time dependent libraries and compile time dependent libraries.

xml and change the company_id parameter. You can download a . Eclipse 1.com-web in /ext/web-sites.Customizing the Portal You can add more instances of the portal by adding different versions of liferay. The directory structure is setup in this manner so that you can easily add different instances of the portal based on the company_id and virtual hostname. read the section called Application Service Provider for more information. Be sure to edit each instance's web. 112 .pdf document outlining instructions on how to customize the portal using Eclipse. For now. We are working to upgrade the script to automate this process.

Instead of placing its JARs in the shared class loader.0 final. The following outlines why this change was necessary: Why Hot-Deployable Themes must use Velocity Templates: Up until Liferay Portal 4.war extension cannot access Liferay's classes because of the new class loader.java for a list of tags that are available to you.war [???] is a web application. These themes are also called hotdeployable themes since you can deploy them at runtime. These themes must be developed using Velocty templates. If you want to create themes using JSP.0RC2.0 .1 to 4. Themes that have a .0. These themes are a great way to learn how to build your own themes using Velocity. This allows Liferay to work with web applications that require different versions of Struts. Building Themes Themes .Chapter 4. Note: All themes developed in ext/themes or themes that have a .0. See our community themes [???] for examples on how to create themes using Velocity templates. See portal/portal-web/docroot/html/themes for examples on how to create JSP themes.0.0. Upgrading Themes from 3. Web applications in tomcat/webapps cannot access Liferay's classes because they are no longer in tomcat/common/lib/ext. We converted all of our community themes [???] to use Velocity.0 and Liferay required Hibernate 3. 113 .Velocity Convert your theme to Velocity. Here's a more concrete example with Tomcat as the servlet container: Tomcat's shared class loader is here: tomcat/common/lib/ext. Should I use Velocity or JSP? Use Velocity for cleaner code and better maintainability. So if a web application required Hibernate 2. This also means that hot-deployable themes cannot access Liferay's classes because they are not in the shared class loader. it is a web application. Liferay no longer places its JARs in the shared class loader. antthemes-4.0.0. etc. Also see VelocityTaglib. Starting from Liferay Portal 4. Hibernate. this would cause conflicts because the JARs in the shared class loader would override the JARs in the web application.0.6. On the other hand. Liferay used to place its JARs in the shared class loader. without any changes to the code.0. If your theme is named *. Liferay now puts them here: tomcat/ liferay/WEB-INF/lib. Use JSP for flexibility or if you do not have time to learn Velocity. you will need to create them in ext/ext-web/docroot/html/themes.0 One of the biggest changes for themes in Liferay Portal 4. The drawback was that JARs in the shared class loader would automatically override JARs in other web applications.Liferay Portal 4. For example. The benefit of this was that all web applications could access Liferay's classes since they were in the shared class loader.0 is that hot-deployable themes must now use Velocity templates. JSP themes must be developed in ext/ext-web/docroot/html/themes.war. These themes must be developed here because they need to access Liferay's classes.war extension must use Velocity templates because they cannot access Liferay's classes.

liferay.com/4. deploy your theme to your server. read this section first: http://content.getLayout This variable was removed After Convert icons in portlet_top. <liferay-portlet:runtime <liferay-util:include Remove "flush" attribute plid getPlid getOwnerId getResolution Only use this method in css.war file or if you developed your theme in ext/themes. If you do not know how to create an extension environment. If you developed your theme as a *. Convert hrefs in top. Images • • Liferay convention is to put all custom images into images/custom Copy default images from Classic theme. If you are using Tomcat.0/docs/quickstart/ch04s01.html [???] The following guidelines will help you to port your theme to Liferay Portal 4.0.0. 2.1 to 4.0. Copy the resulting "ant-themes-4. Then copy the resulting theme directory to ext/ext-web/docroot/html/themes. the theme will be deployed to tomcat/webapps. Skip this step if your theme is already located in ext/ext-web/docroot/html/themes.0 . Convert “Communities” to “My Places” <div id="layout-my-places"> <liferay-portlet:runtime portletName="<%= PortletKeys.war.0. 7.0" directory is empty you have not deployed the theme correctly.jsp to <liferay-portlet> taglib icons: <liferay-portlet:icon-configuration /> <liferay-portlet:icon-edit /> <liferay-portlet:icon-edit-guest /> <liferay-portlet:icon-help /> <liferay-portlet:icon-print /> <liferay-portlet:icon-minimize /> <liferay-portlet:icon-maximize /> <liferay-portlet:icon-close /> 4. deploy this theme to your server.0" directory and all of its contents to ext/ext-web/docroot/html/themes When you are finished the directory structure should look like this: ext/ ext-web/docroot/html/themes/ant-themes-4.0. If your "ant-themes-4. Convert the JSPs: Before <liferay:runtime-portlet <liferay:include flush=”true” layoutId getLayoutId getUserId getResTotal LayoutServiceUtil.0.jsp to use themeDisplay getter methods getURLMyAccount getURLSignOut getURLAddContent getURLPageSettings getURLSignIn 5.0. Example: If your theme is ant-themes-4.jsp LayoutLocalServiceUtil.Building Themes Upgrading Themes from 3. CSS Styles 114 .getLayout tilesSubNav 3.6.0.JSP Port your theme to the ext/ext-web/docroot/html/themes directory. 1.0.MY_PLACES %>" /> </div> 6.0.

Building Themes • • Remove any styles with “n1” or “w1” in the name Add the following styles: portal-add-content layout-column_column-? layout-column-highlight portlet-dragging-placeholder layoutmy-places • Change the following styles: Before After . It will also discuss how to use Themes in conjunction with other features to easily build your website within Liferay Portal.war file. Themes make it possible to easily switch to different presentations or "look and feel" layers. image.1 This tutorial will explain Liferay Portal’s themes feature in detail. Liferay Portal comes with a handful of pre-made themes that showcase its versatility: 115 .current #gamma-tab #current Themes . a designer/developer can deliver an integrated package of JSP (or Velocity).Liferay Portal 3. Javascript. and configuration files that will control all presentation logic and design attributes for a portal community. Within a single .6.gamma-tab .

Building Themes 116 .

take a look at the bundled "Velocity" theme (Figure 2. this convention will make your themes easier to organize and keep them standard. 3.a.wars (when supported by the app server) To select a different theme.1).k.3). communities) • Users can choose a unique theme for their own personal portal page • Both Java Server Page (JSP) and Velocity (VM) languages are supported • Themes are hot-deployable as .1. 2.1.1). 117 . Making Your Own Theme Making a new theme requires only four main steps: 1. Note: If you want to see an example using VM.6) by modifying a few things in a copy of the "Classic" theme (Figure 2. we created a copy of the "Classic" theme’s directory and renamed it "brochure. Configure properties Edit templates (JSP or VM) Define CSS styles Code JavaScript (optional) Let’s take a high-level look at how Liferay created the JSP-based "Brochure" theme (Figure 2. Although you do not have to follow the layout shown here. We then deleted the color-schemes directory because we decided we would only have one color scheme for the "Brochure" theme. Configuration First." (Figure 2. go to the Look and Feel section in the header bar and choose one of the available themes and a corresponding color scheme.Building Themes • Different themes can be assigned to specific user groups (a. 4. The process is as straightforward as setting a new desktop background in Windows.

templates-path and images-path are also set here.color-scheme content omitted to simplify example --> </color-scheme> </theme> </look-and-feel> 118 . you need to let Liferay know the new theme’s directory location. Make sure that these values match your directory structure. <look-and-feel> <compatibility> <version>3.6.1.Building Themes Figure 2.1.2). This is done in liferay-look-and-feel. The root-path.1</version> </compatibility> <theme id="brochure" name="Brochure"> <root-path>/html/themes/brochure</root-path> <templates-path>/html/themes/brochure/templates</templates-path> <images-path>/html/themes/brochure/images</images-path> <template-extension>jsp</template-extension> <color-scheme id="01" name="Default"> <!-. Notice that the theme configuration shows theme id="brochure" and identifies the compatible version.1.xml (Figure 2.1.1 Directory structure Once a directory is created to house your new theme.

2 Liferay-look-and-feel.jsp Initializes variables and properties needed for the theme. For instance.1. Controls the layout of portal templates for normal pages.isSignedIn() %>"> <div id="layout-user-menu"> 119 . Draws the bottom of each portlet. Some of the required code changes are displayed below in Figure 2. Also notice that the buttons are now simple text links. portlet_top. Contains JavaScript declarations.1. Draws the top of the portal. Just make sure to include the template in portal_normal. you can see one such major change made to the placement and appearance of the portal configuration menu (Figures 2.1.xml Templates Now that Liferay Portal is configured to load your theme. Here is a brief description of some of the templates that are used in the default theme.jsp determines how the navigation bar will look.3: <div id="layout-outer-side-decoration"> <div id="layout-inner-side-decoration"> <div id="layout-top-decoration"> <div id="layout-corner-ul"></div> <div id="layout-corner-ur"></div> </div> <div id="layout-box"> <div id="layout-top"> <div id="layout-logo"> <a class="bg" href="<%= themeDisplay. In the figures below.jsp and/or portal_pop_up. In contrast.jsp Draws the top of each portlet. Each template controls the layout of a particular area within the portal.2.2 The "Brochure" theme's portal config menu is relocated to the top of the portal.getPathFriendlyURL() %>/guest/home"><img border="0" hspace="0" src="<%= themeDisplay.jsp navigation.jsp.jsp bottom.jsp portlet_top. navigation.1. the "Brochure" theme has the portal configuration menu relocated to the top of the portal and separated from the navigation bar. Contains CSS style definitions for your entire theme. javascript. A number of changes were made to these templates for the brochure theme. It consists of buttons and a dropdown menu.jsp css.1 and 2.2. init. Draws the navigation bar of the portal. Keep in mind that not all of these templates require modification nor are you limited to the ones mentioned here. In the "Classic" theme. the next step is to edit the template files that give the theme its uniqueness. the portal configuration menu is part of the navigation bar.1. Draws the bottom of the portal.Building Themes Figure 2.1.1.getCompanyLogo() %>" vspace="0"></a> </div> <c:if test="<%= themeDisplay.jsp portal_normal.2. Draws the top of each portlet.jsp controls the top portion of each portlet.2. Figure 2.2): Figure 2.jsp top. Feel free to add another template to control a different area of the portal. Controls the layout of portal templates for pop-ups.jsp portal_pop_up.1 The "Classic" theme's portal config menu is integrated with the tabs.2.

getGroups(user.jsp.DEFAULT_PARENT_GROUP_ID %>"><%= LanguageUtil. i++) { Group myCommunity = (Group)myCommunities.jsp contains all the CSS style definitions for your theme. css.get(i).get(pageContext.isPowerUser(user.size().getName() %></option> <% } %> </select> </font> </div> </c:if> Figure 2. you can use standard and custom style definitions to give your theme a distinctive look and feel. As mentioned briefly above. Liferay Portal’s default themes include all JSR-168 standard style definitions.getGroupId() %>"><%= myCommunity. Using the templates and adding custom images as necessary. %> <option <%= layout.getUserId()) %>"> <a style="font-size: 8pt" href="<%= themeDisplay. color: " + colorScheme.getPathMain() %>/portal/look_and_feel_forward?group_id=<%= portletGroupId %>"><%= LanguageUtil. Let’s look at some of the style changes made in the "Brochure" theme.3 top. padding."> <%= LanguageUtil.get(pageContext.Building Themes <a style="font-size: 8pt. and margin.getBoolean(PropsUtil.LOOK_AND_FEEL_MODIFIABLE)) %>"> <a style="font-size: 8pt" href="<%= themeDisplay.get(pageContext. font-size: smaller.isGroup() ? selectedStyle : "" %> value="<%= Group.value. "look-and-feel") %></a> </c:if> <font class="portlet-font" style="font-size: 8pt.getURLSignOut() %>"><bean:message key="sign-out" /></a> <c:if test="<%= GetterUtil.2. for (int i = 0. 120 . font-weight: normal. i < myCommunities. You may also add theme-specific style definitions to css.getPathMain() %>/portal/group_forward?group_id=' + this. The best way to control these attributes in your theme is to use cascading style sheets (CSS).getPortletMenuBg() + ".getGroupId()." href="<%= themeDisplay. "desktop") %></option> <% List myCommunities = UserLocalServiceUtil.location = '<%= themeDisplay.get(PropsUtil.get(pageContext.equals(myCommunity.getGroupId()) ? selectedStyle + "selected" : "" %> value="<%= myCommunity.getPortletMenuText() + ".\" ".getPathMain() %>/portal/personalize_forward?group_id=<%= portletGroupId %>"><%= LanguageUtil.1.UNIVERSAL_PERSONALIZATION)) || RoleLocalServiceUtil."> <option <%= !layout. "content-and-layout") %></a> </c:if> <c:if test="<%= GetterUtil. "my-communities") %> </font> <% String selectedStyle = "style=\"background: " + colorScheme." onChange="self. background color.isGroup() && layout.get(PropsUtil. %> <font size="2"> <select name="my_communities_sel" style="font-family: Verdana.getUserId()).getBoolean(PropsUtil. Arial.jsp for the "Brochure" theme CSS Styles Another major part of every theme is the collection of presentation attributes such as font size.

then provide the location of this file in the script declaration in javascript. For example. To use a script.getPortletTitleText() %> font-family: Tahoma.jsp" %> <div class="portlet-container" style="width: <%= portletDisplay. Arial.isNotNull(portletDisplay. font-size: smaller.jsp.getTitle() %> </b> </div> </c:if> The style definition portlet-header-bar is used in the portlet_top template.js and it is located in html/themes/my_themes/js. z-index: 2. The portlet_top template is used to draw the top of each portlet within the portal. For example: . put the script file inside your theme directory.getWidth() %>"> <div class="portlet-header-bar"> <c:if test="<%= Validator.Building Themes Header Bar .portlet-header-bar { background-color: #e0e0e0. position: relative. depending on the color scheme selected on the "Look and Feel" page in the portal. JavaScript You can use JavaScript to create a more dynamic interface for your theme.getTitle()) %>"> <div class="portlet-title"> <b> <%= portletDisplay. } In the above code. Because the style sheet is a JSP file. if your JavaScript file is called my_script. portlet-title’s color attribute has its value retrieved dynamically.xml. make the following declaration in javascript. the header bar for each portlet should have a gray background color. } <%@ include file="init. This way. with a small margin on its sides. As you can see from the portlet-header-bar definition.getPathThemeRoot() %>/js/my_script. padding: 3px 0px 3px 0px. margin: 0 1px 0 1px. the title bar will have a color appropriate to the currently selected color scheme. Please refer to the theme user guide for more information.portlet-title { color: <%= colorScheme.js"></script> 121 . padding on top and bottom.jsp: <script language="JavaScript" src="<%= themeDisplay. vertical-align: middle. Dynamic Style Values Style values can be retrieved dynamically from color scheme variables defined in liferay-look-and-feel. positioned relatively and with a z-index of 2. you can use JSP tags to dynamically assign some of your style definition values.

To illustrate. Right next to it is another portlet with CMS articles on customer testimonials. If this insurance company uses Liferay to build their website. The Runtime Portlet is used to embed portlets into CMS articles. suppose an insurance company wants to show their prospective customers how much they can save by switching to their insurance plan. but you can set the layout of several portlets dynamically using HTML and CSS. The Breadcrumb Portlet keeps track of how deep a user has gone into the navigation of a site. Using the above example. In this new version. Figure 2. One direct application of this capability is to create your public website using Liferay.4) use JavaScript to create a dynamic interface. The layout of the page the articles live in is managed within the portal’s admin section. This portlet is used at Liferay. the insurance company may want one portlet containing a CMS article describing their pricing. let’s take Liferay’s "Company Overview" page as an example. Online visitors can go to their website.5) and the "Genesis" theme (Figure 2.Building Themes The JSP expression <%= themeDisplay. Both the "Clean" theme (Figure 2. The CMS-managed article describing the plan can be placed right beside the calculator portlet.1 shows the webpage with each of the five portlets marked. Layout is handled strictly through portal page configuration. Liferay Portal has several enhancements that make it very straightforward to combine static CMS articles and functionality-rich portlets on the same portal page. As an example. Besides providing functionality. and thereby enable the inclusion of portlets on your website. These and other portlets can be re-used and easily included on every content page where they are needed. please see the Liferay Portal User Guide. You can thus easily bring various articles together to assemble a website. (You can view the actual page here) 122 . Note: For documentation on Liferay’s CMS. Not only would you be able to reuse functional components and find innovative ways to use them. Liferay Portal allows CMS articles to be inserted into your portal just like any other portlet. fill out a short form. If two different pages on your website need to offer the same functionality. incorporating portlets into your website helps to encourage reuse. they can easily develop a pricing calculator portlet. and display it on the front page of their website.1. You are no longer confined to the strict rigidity of a column layout. CMS + Portal = Website In addition to themes. and the content and layout of the individual articles is easily maintained through the journal portlet. grant guest access. Also. Liferay Portal also comes with portlets specifically designed to help you build a public website easily. but you could also quickly build new pages out of common components within a tightly-managed CMS framework.getPathThemeRoot() %> helps keep you from hard-coding information in your templates. and receive pricing information instantaneously. Liferay Portal also ships with the Runtime Portlet and the Portlet Aggregator.com to embed an instance of the Login Portlet within the article that is displayed on the main web page. Example of CMS and Web Portal Integration Liferay’s main website was recently rebuilt to utilize the portal instead of using linked CMS pages. Once the main Theme layout has been created. Refer to the API to see other variables and methods available to you. The Portlet Aggregator provides a flexible means to lay out several portlets. pages can be put together using these portlets without touching the presentation code.4. one portlet can simply be placed in both pages. each page on the website is a layout (page) comprised of several different portlets. The Navigation Portlet can be configured to act as a standard nested navigation menu. a website also needs to provide information.

Building Themes Figure 2.1. delete. and organize page layouts by using the Admin section (Figure 2.com. containing various portlets that supply its content. You can add. 123 .2). denoted in Figure 2. each contains its own CMS article. one narrow and one wide. Portlet one and three contain a single picture each." like most other pages on Liferay. is a portal layout (page) with two columns. respectively. Portlets two and four.1 Company Overview "Company Overview. accessed by the "Content and Layout" button. are instances of the Navigation and Breadcrumb Portlets.4. and portlet five contains a detailed overview of Liferay.4.1.1. The remaining three portlets are instances of the Journal Content portlet.4.1.

5.4..com/c/portal/layout?p_p_id=34. [about:blank]. Also notice the Friendly URL field.. This field allows you to assign a simple URL to a layout. For example. to add the Breadcrumb Portlet to the right column: 1. we added the "Company" layout right under the "Home" layout.Building Themes Figure 2. Go to the bottom of the right column Choose Breadcrumb in the dropdown menu Click the Add button To add a CMS article in the left column: 1.1.2 Admin Portlet For the Company page. Go to the bottom of the left column Choose Journal Content in the dropdown menu Click the Add button Click the Edit button to specify the ID of the article you want Specify whether you would like to see a border 124 . 4. 2. you can use a simplified URL like www. you can add different portlets to quickly assemble your webpage. So instead of linking to this page with the URL www. 2.liferay. 3. Once the "Company" page layout has been added.liferay. 3.com/web/guest/company [about:blank].

To see Liferay Portal in action. we set the "margin" attribute in the "Brochure" theme to zero. Conclusion Liferay provides a lot of flexibility and control to customize the overall user experience of your portal or website.liferay. remember to extract all the presentation attributes to your theme. use.com to get a sense of how the portal was used to build that site and begin to imagine the possibilities for your own website or portal. Add an optional title and click the Save Settings button Note: When assembling your webpage.Building Themes 6.net and create a user account for yourself. You can also explore Liferay. all the attributes are centralized. visit demo. 125 . to remove the gap between the wide and narrow columns. The availability of a number of different ways to manage. For example. and display CMS content and portlets provides limitless possibilities for innovation using Liferay Portal. This way.

Each portlet can have its own service.xml file for the Bookmarks Portlet.Chapter 5.References --> <reference package-path="com.xml." package-path="com.PK fields --> <column name="entryId" type="String" primary="true" /> <!-.0//EN" "http://www. The business and persistance tier classes are auto generated based on specifications outlined in a file called service.Order --> <order by="asc"> <order-column name="folderId" /> <order-column name="name" case-sensitive="false" /> </order> <!-.Audit fields --> <column <column <column <column name="companyId" type="String" /> name="userId" type="String" /> name="createDate" type="Date" /> name="modifiedDate" type="Date" /> <!-. <?xml version="1. Custom portlet exceptions can also be auto generated.liferay.liferay.0"?> <!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 4..xml where the portlet and each entity in the portlet are defined. Code Generation service. and other fields used in the table as well as any finder methods that will be required.liferay. audit fields.Other fields --> <column <column <column <column <column name="folderId" type="String" /> name="name" type="String" /> name="url" type="String" /> name="comments" type="String" /> name="visits" type="int" /> <!-.portlet"> <portlet name="Bookmarks" short-name="Bookmarks" /> <entity name="BookmarksEntry" local-service="true" remote-service="true"> <!-. Below is an example service.xml Liferay Portal features a convenient code generation module that allows the developer to auto generate all of the "Model" components for a portlet.Finder methods --> <finder name="FolderId" return-type="Collection"> <finder-column name="folderId" /> </finder> <!-.0.com/dtd/liferay-service-builder_4_0_0.dtd"> <service-builder root-dir=". A portlet entity is defined as a table specifying primary keys.portal" entity="Resource" /> </entity> 126 .

liferay. BookmarksEntry is generated once and extends BookmarksEntryModel.PK fields --> <column name="folderId" type="String" primary="true" /> <!-.Audit fields --> <column <column <column <column name="companyId" type="String" /> name="userId" type="String" /> name="createDate" type="Date" /> name="modifiedDate" type="Date" /> <!-.Code Generation <entity name="BookmarksFolder" local-service="true" remote-service="true"> <!-.xml in /portal-ejb.portal" entity="Resource" /> </entity> <exceptions> <exception>EntryURL</exception> <exception>FolderName</exception> </exceptions> </service-builder> Upon reading service. Each portlet that persist data has its own service.Finder methods --> <finder name="GroupId" return-type="Collection"> <finder-column name="groupId" /> </finder> <finder name="G_P" return-type="Collection"> <finder-column name="groupId" /> <finder-column name="parentFolderId" /> </finder> <!-.Group instance --> <column name="groupId" type="String" /> <!-. Do edit BookmarksEntry to add hand massaged code. the following model classes are generated.Other fields --> <column name="parentFolderId" type="String" /> <column name="name" type="String" /> <column name="description" type="String" /> <!-. 127 .Order --> <order by="asc"> <order-column name="parentFolderId" /> <order-column name="name" case-sensitive="false" /> </order> <!-. which reads the file service.xml found in the Bookmarks portlet. Never edit BookmarksEntryModel.References --> <reference package-path="com. Copy this file to /portal-ejb when you want to generate the persistence classes for that portlet. Each model class reflects a table in the database.xml (do a search in /portal-ejb and you will get a list back). Most of the EJBs. HBMs. This is an internal tool that is built on top of the XDoclet engine. and Models are generated through the ant task build-service. This allows the ease of generated code and flexibility of hand massaged code.

upon reading service.portlet.liferay. This allows for an n-tier architecture for cases where your model classes are marshalled across the wire and your Hibernate classes are not.persistence. these classes allow you to delete a bookmark entry or folder only if you are the creator of that entry or folder.service. Instead of writing many lines of code just to look up the appropriate Session EJB wrapper or POJO implementation.BookmarksFolderModel Hibernate classes are generated that map to the model classes. find.service. The Session EJB that extends the POJO implementation implements PrincipalSessionBean.bookmarks.Code Generation For example.persistence.persistence.bookmarks.service.portlet.persistence.liferay.bookmarks. They help save developer time and prevent polluted code.service.portlet.bookmarks.portlet.bookmarks.bookmarks. the following model classes are generated.BookmarksEntryServiceImpl com. It can be a traditional database. For example.impl.BookmarksFolderPersistence Helper classes are generated that call the persistence methods.BookmarksFolderServiceImpl Helper classes are generated based on the POJO implementations.service.liferay.portlet.bookmarks.portlet.addEntry to call the equivalent method in Bookmark128 .model.persistence. com. the helper classes call the Hibernate persistence methods to update the database.liferay.BookmarksEntryModel com.BookmarksFolderUtil Pooling classes are also created to minimize object creation.model. com.portlet.properties and set your own persistence class as long as it extends the default persistence class.persistence.liferay. These classes are only generated once if they do not already exist. This allows you the ease of generated code and flexibility of hand massaged code.BookmarksEntry com.liferay.service.service. delete.model.service. BookmarksEntry is generated once and extends BookmarksEntryModel. remove. By default.impl.service. a LDAP server. or even something else.bookmarks.bookmarks. Never edit BookmarksEntryModel.portlet. com. com.BookmarksEntryPersistence com.model.liferay.BookmarksEntryHBM com.liferay. com.BookmarksFolder com.portlet.liferay.xml found in the Bookmarks portlet. you simply call BookmarksEntryServiceUtil.persistence.portlet. This means you can customize where you store your data.bookmarks.BookmarksEntryPool com. update.portlet.bookmarks.portlet.properties.BookmarksFolderHBM Persistence methods to add. Behavior can be modified in portal. Each model class reflects a table in the database.liferay.BookmarksEntryUtil com. Do edit BookmarksEntry to add hand massaged code. You can override this in portal. and count the Hibernate entries are generated as the default persistence mechanism.liferay.liferay.liferay. Calling getUserId() returns the user id of the current user.portlet.persistence. Calling getUser() returns the User model that represents the current user.liferay.bookmarks.bookmarks. com.bookmarks.service.portlet.BookmarksFolderPool POJO implementations that extend PrincipalBean are generated to hold business logic that check the caller principal and can be called remotely.

bookmarks.bookmarks.BookmarksFolderServiceEJB com.portlet.service.spring. com.portlet.portlet.portlet.bookmarks.portlet.service.portlet. These classes are only generated once if they do not already exist.BookmarksFolderLocalServiceImpl Helper classes are also generated. com.service.BookmarksEntryServiceUtil com.Code Generation sEntryServiceImpl.bookmarks.ejb.http.BookmarksFolderServiceSoap POJO implementations classes that do not extend PrincipalBean are generated to hold business logic that do not check the caller principal and can be called locally.portlet.portlet.ejb.portlet.BookmarksEntryServiceHttp com.liferay.seervice.service.service.service.BookmarksFolderServiceUtil Tunneling classes are generated so that developers can call the POJO implementations over port 80.ejb.liferay.bookmarks.liferay.liferay.portlet.portlet.bookmarks.liferay.http.portlet.BookmarksEntryServiceSoap com. These classes exist so that business logic can be easily integrated with other projects.spring. The Session EJB extends the POJO implementation.portlet.liferay.liferay.service.liferay.BookmarksFolderServiceHome com.service.service.BookmarksEntryServiceHome com.bookmarks.impl.bookmarks. com.bookmarks.ejb.bookmarks.addEntry.bookmarks.service.BookmarksEntryService com. An example of this is given in section V of this document.service.bookmarks.service.service.BookmarksEntryLocalServiceEJBImpl 129 .bookmarks.bookmarks.portlet.ejb.portlet.properties on whether to load the Session EJB wrapper or the plain POJO implementation.ejb.http.BookmarksFolderServiceHttp Soap classes are generated so that developers can call the POJO implementations over port 80.portlet.liferay. com.BookmarksEntryLocalServiceImpl com.liferay.spring.portlet.BookmarksEntryServiceFactory com.spring.http.bookmarks.service.liferay.BookmarksFolderService com.BookmarksFolderServiceEJBImpl com.bookmarks.liferay.service.BookmarksFolderServiceFactory com.liferay. Soap is more flexible than tunneling because the client classes are not limited to Java.liferay.BookmarksEntryServiceEJB com.service.service.BookmarksEntryLocalServiceEJB com.spring.liferay.bookmarks.portlet.liferay.impl.portlet.bookmarks. BookmarksFolderServiceFactory defers to Spring and settings in portal.ejb.liferay.service.liferay. com.liferay.BookmarksEntryServiceEJBImpl com.bookmarks. BookmarksEntryServiceUtil calls BookmarksFolderServiceFactory to look up the class that implements BookmarksEntryService.liferay.spring.portlet. Soap is slower than tunneling because tunneling streams request in binary format.service.bookmarks.ejb.

portlet.bookmarks.liferay.liferay.portlet.liferay.spring.BookmarksEntryRemoteServiceEJB com.service.liferay.bookmarks.ejb.bookmarks.bookmarks.service.portlet.BookmarksEntryLocalServiceFactory com.service.bookmarks.service.portlet.BookmarksFolderLocalServiceHome com.portlet.portlet.bookmarks.spring.liferay.spring.spring.portlet.ejb.service.service.service.bookmarks.service.liferay.service.ejb.BookmarksFolderRemoteServiceEJBImpl com.portlet.BookmarksFolderRemoteServiceEJB com.portlet.service.bookmarks.portlet. so Remote Service classes that parallel their Local counterparts are also generated.liferay.spring.bookmarks.liferay.bookmarks.BookmarksFolderLocalServiceEJB com.service.BookmarksEntryRemoteServiceHome com.liferay.portlet.bookmarks.ejb.ejb.spring.liferay.service.service.service.liferay.portlet.liferay.bookmarks.portlet.ejb.BookmarksEntryLocalService com.spring.bookmarks.BookmarksEntryLocalServiceUtil com.BookmarksEntryRemoteServiceUtil com.ejb.BookmarksFolderRemoteServiceHome com.bookmarks.liferay.Code Generation com.service.spring.BookmarksEntryRemoteServiceEJBImpl com.bookmarks.bookmarks.service.portlet.portlet.BookmarksEntryLocalServiceHome com.spring.portlet.ejb.BookmarksFolderRemoteServiceUtil 130 .liferay.liferay.liferay.liferay.service.BookmarksFolderLocalService com.bookmarks.bookmarks.service.service.ejb.spring.liferay.spring.service.BookmarksFolderLocalServiceUtil Some of our users needed to call the Local Service classes remotely. com.BookmarksFolderRemoteServiceFactory com.liferay.portlet.spring.portlet.bookmarks.service.portlet.bookmarks.BookmarksEntryRemoteService com.BookmarksFolderLocalServiceFactory com.ejb.BookmarksEntryRemoteServiceFactory com.bookmarks.liferay.portlet.liferay.portlet.BookmarksFolderLocalServiceEJBImpl com.bookmarks.liferay.BookmarksFolderRemoteService com.portlet.service.

Check to see that /home/liferay/deploy exists.6. 4. JBoss+Tomcat. Go to the drive where you installed your server. JSR 168 portlets. Tomcat or WebSphere. If it does not. create it. Jetty. If you have already set up the extension environment. and themes. Resin. Start the server. themes and layouts. theme or layout. 131 .) Install either JBoss+Jetty. sample portlets or themes to /home/liferay/deploy. you can hot deploy portlets. 5. (Any JSR 168 compliant portlet WAR will work as well. JSR 168 portlets add functional abilities to the portal.war file is a JSR 168 compliant portlet WAR. layouts or themes by dropping them into ext/portlets. Deployment Hot Deploy Liferay allows you to easily hot deploy layout templates. make sure that your *. (You cannot use themes and layouts designed for Liferay Portal v3.Chapter 6. Portlets and Themes 1.1 or layouts and themes that were designed for other portals). Layout Templates. 3. Then run ant deploy from that directory.war files. The server will now automatically scan for *. You can also customize the location of this directory from the Admin portlet: 2. Layout templates. Click here [http://www. ext/layouttpl or ext/themes respectively. portlets and themes can be deployed at runtime by utilizing the hot deploy features of Liferay. Notes: If the hot deploy feature does not work. Download one of the layout templates. Layout templates allow portlets to be arranged inside the constraints of custom layouts.com/web/guest/downloads/samples] for a list of sample portlets. Themes modify the look and feel of the portal.liferay.

Liferay portal needs to know whether there are resources that require permission and whether there are custom permissions.)..” Associate the necessary permissions to these resources.g. This document will provide a reference for implementing this new security feature into their custom portlets. This is also known simply as “adding resources. Calendar Events. Security and Permissions Introduction Fine grain permissioning is one of the main new features of Liferay Portal. In each of the subsections below. For all the resources defined in step 1. etc. However. Message Boards. register them into the permission system. Keep in mind that the permission for a portlet resource is implemented a little differently from the other resources such as Java classes and files. 3.g. Developers can now implement access security into their custom portlets. This information is encapsulated in an XML file found in the portal/ portal-ejb/classes/resource-actions directory. Implementing Permissions In this section. 4. The following are two definitions that are important to remember. If your portlet only needs the view and the configuration permission. and files (e. then the model (and file) resource. Let’s take a look at blogs. The reason is that all portlets in Liferay automatically inherit these two permissions..Chapter 7. giving administrators and users a lot more control over their portlets and contents. Java classes (e. Message Board Topics. etc.). images. etc.. Resource: a generic term for any object represented in the portal. 2. Calendar. documents. then you do not need to create this XML file. if your portlet does have custom permission and/or uses models that have custom permissions. Defining Resources and Actions For your custom portlet. Example of resources includes portlets (e. the view in “viewing the calendar portlet” is defined as a permission in Liferay. and that the portlet doesn’t use any models with permission. Check permission before returning resources.xml in portal/ portal-ejb/classes/resource-actions and see how the blogs portlet defined these resources and actions: 132 . Define all resources and their permissions.g. the permission implementation for the portlet resource is explained first. then you will need to create an XML file defining the resources and actions. For example. Developers should first read the Security and Permissions section of the Liferay User Guide before continuing with this document. Permission: an action acting on a resource. each of the four main steps in adding Liferay’s security feature into custom portlets (built on top of the Liferay portal) will be explained.). Overview Adding fine grain permissioning to custom portlets consists of four main steps (also known as DRAC): 1.

portlet.blogs.0"?> <resource-action-mapping> <portlet-resource> <portlet-name>33</portlet-name> <supports> <action-key>ADD_ENTRY</action-key> <action-key>CONFIGURATION</action-key> <action-key>VIEW</action-key> </supports> <community-defaults> <action-key>VIEW</action-key> </community-defaults> <guest-defaults> <action-key>VIEW</action-key> </guest-defaults> <guest-unsupported> <action-key>ADD_ENTRY</action-key> </guest-unsupported> </portlet-resource> <model-resource> <model-name>com.liferay.blogs.portlet.model.liferay.BlogsEntry</model-name> <portlet-ref> <portlet-name>33</portlet-name> </portlet-ref> <supports> <action-key>ADD_COMMENT</action-key> <action-key>DELETE</action-key> <action-key>PERMISSIONS</action-key> <action-key>UPDATE</action-key> <action-key>VIEW</action-key> </supports> <community-defaults> <action-key>VIEW</action-key> </community-defaults> <guest-defaults> <action-key>VIEW</action-key> </guest-defaults> <guest-unsupported> <action-key>UPDATE</action-key> </guest-unsupported> </model-resource> </resource-action-mapping> 133 .model.BlogsCategory</model-name> <portlet-ref> <portlet-name>33</portlet-name> </portlet-ref> <supports> <action-key>DELETE</action-key> <action-key>PERMISSIONS</action-key> <action-key>UPDATE</action-key> <action-key>VIEW</action-key> </supports> <community-defaults> <action-key>VIEW</action-key> </community-defaults> <guest-defaults> <action-key>VIEW</action-key> </guest-defaults> <guest-unsupported> <action-key>UPDATE</action-key> </guest-unsupported> </model-resource> <model-resource> <model-name>com.Security and Permissions <?xml version="1.

the XML file would normally reside in portal/ portal-ejb/classes/resource-actions and a reference to the file would appear in the default. Likewise. The community-defaults tag defines what actions are permitted by default for this portlet on the community (group) page the portlet resides. developers should ask themselves what actions belong to the portlet itself or what actions are performed on the portlet that may require a security check. which you may use multiple <portlet-name> tags to define. add a comma to the end of the property value and then add the path to your default-ext.1. we move on to define models within the portlet that also require access check. a user with access to the community containing the blogs portlet should be able to view it. the guest will see an error message within the portlet. For Liferay core. Similar to the portlet resource element.configs=resource-actions/default. the guest-defaults tag defines what actions are permitted by default to guests visiting a layout containing this portlet. For example.Security and Permissions Portlet Resource In the XML. resource. The guestunsupported tag contains actions that a visiting guest should never be able to do.xml) Below is an example of the default. Then copy the property resource. a user must have permission in order to add comments to an entry. you then need to tell Liferay the location of this file.actions. we move on to define some of the default permission settings. Each of these supported permissions is within its own <action-key> tag.0"?> <resource-action-mapping> <resource file="resource-actions/portal. Within this tag. a model can belong to multiple portlets. you may add more actions here that make sense.configs found in portal. we have a child element called <portlet-resource>. the <guest-defaults> tag. and the <guest-unsupported> tag are all similar in meaning to what’s explained for portlet resource in section 3. Put it another way. Next we define the portlet name that this model belongs to under the portlet-ref tag. As you can see for a blog entry. Next.properties. be able to view the portlet according to blogs. there is no way for her to grant that permission because the blogs. delete an entry.xml (not necessarily the content of the portlet). Create a file called default-ext. The <community-defaults> tag. Model Resource After defining the portlet as a resource. the guest visiting the blogs portlet should never be able to add a blog entry since the blog belongs to either a user or a group of users. To understand what should be listed here.xml" /> <resource file="resource-actions/blogs. You must list out all the performable actions that require a permission check. In our case. change the permission setting of an entry. (i.xml file.xml file.xml. we first define the model name. which is 33 in our case. configure blogs portlet settings (CONFIGURATION). Keep in mind that this is at the portlet level. the first thing defined is the portlet itself.resource-actions/default-e xt. or simply to view an entry. users need permission to add an entry (ADD_ENTRY). Though unlikely.xml file. we list all the actions this portlet supports under the <supports> tag.xml file. the recommended setup is to put your XML file in ext/ ext-ejb/classes/resource-actions.xml and model it after the default. Right under the root element <resource-action-mapping>.1. Default. This must be the fully qualified Java class name of the model. Otherwise. the model resource element also allows you to define a supported list of actions that require permission to perform. and view the blogs itself (VIEW). So if a guest has access to the community page that contains a blogs portlet. update an entry. at the very least.xml doesn’t permit such an action for guests.xml After defining your permission scheme for your custom portlet. For the EXT environment.e. the guest should. Lastly.xml" /> 134 . In this element. After we’ve defined all the actions that require a check.xml file. So even if a user wants to grant guests the ability to add a blog entry to her blog.properties and paste it into portalext. what should a user that has access to the community this portlet resides be able to do minimally? For the blogs portlet.actions. <?xml version="1. Add all your custom resource-action XML files in the default-ext. we define the portlet name. Depending on your custom portlet. The model resource is surrounded by the <model-resource> tag.

Of course. entry. Simply call the deleteResource(…) method in ResourceLocalServiceUtil. we set it to false because we’re adding a model resource. entry.getCompanyId(). So adding resources is as easy as calling the add resource method in ResourceLocalServiceUtil class.xml" /> <resource file="resource-actions/documentlibrary. The addCommunityPermissions and the addGuestPermissions parameters are inputs from the user.xml" /> <resource file="resource-actions/communities. UI Interface If you would like to provide your user the ability to choose whether to add the default community permission and the guest permission for the resources within your custom portlet.xml" /> </resource-action-mapping> Adding Resources After defining resources and actions. which should be associated with permissions related to the model action defined in blogs. Deleting Resources To prevent having a lot of dead resources taking up space in the Resource_ database table.xml" /> <resource file="resource-actions/journal. For all the Java objects that require access permission. public void addResources( String companyId. The primKey parameter is the primary key of the resource object. String primKey. and userId should be self explanatory. addGuestPermissions).xml" /> <resource file="resource-actions/shopping.xml" /> <resource file="resource-actions/calendar. false.getUserId(). you need to make sure that they are added as resources every time a new one is created.getName(). If set to true. the addResources(…) method is called to add the new entry to the resource system. you must remember to remove them from the Resource_ table when the resource is no longer applicable. every time a user adds a new entry to her blog.xml. Simply insert the <liferay-ui:input-permissions /> tag into the appropriate JSP and the checkboxes will show up on your JSP.xml" /> <resource file="resource-actions/wiki. Liferay has a custom JSP tag you may use to quickly add that functionality. boolean addCommunityPermissions. A lot of the logic to add resources is encapsulated in the ResourceLocalServiceImpl class.addResources( entry.getGroupId(). BlogsEntry. boolean addGuestPermissions). String name.xml" /> <resource file="resource-actions/polls. Here’s an example of a blogs entry being removed: 135 .Security and Permissions <resource file="resource-actions/bookmarks.xml" /> <resource file="resource-actions/messageboards. In our example.class. set this to true if you’re adding portlet action permissions. the next task is to write code that adds resources into the permissioning system. String userId.getPrimaryKey(). entry.toString(). addCommunityPermissions. For example. The parameters companyId. make sure the tag is within the appropriate <form> tags. The name parameter is the fully qualified Java class name for the resource object being added. boolean portletActions. String groupId. ResourceLocalServiceUtil. ResourceLocalService will then add the default permissions to the current community group and the guest group for this resource respectively. As for the portletActions parameter.xml" /> <resource file="resource-actions/imagegallery. Here’s an example of the call from the BlogsEntryLocalServiceImpl class. groupId.

2. You can do that by checking the permission first before performing the intended functionality. those are automatically added to a list of permissions and users can readily choose them. This will be covered in section 3. Adding Permission Portlet Permission On the portlet level. and var. model.getName() %>" modelResourceDescription="<%= entry.getTitle() %>" resourcePrimKey="<%= entry.1). It then gets translated in Language. resourcePrimKey.3.resource. If you’ve defined any custom permissions (supported actions) in your portlet-resource tag in section 3.com. you’ll need to show or hide certain functionality in your portlet.Security and Permissions ResourceLocalServiceUtil. BlogsEntry. you will need to expose the permission interface to the user. modelResourceDescription.SCOPE_INDIVIDUAL. Resource. for your custom permissions to have any value. The modelResource attribute is the fully qualified Java object class name.toString() %>" var="entryURL" /> <liferay-ui:icon image="permissions" url="<%= entryURL %>" /> The attributes you need to provide to the first tag are modelResource.BlogsEntry=Entry 136 . This can be done by adding two Liferay UI tag to your JSP. Your custom portlet will automatically have all the permission features.1.liferay.portlet.getPrimaryKey(). entry.properties to a more readable name (underlined in red in figure 3.blogs.model. <liferay-security:permissionsURL modelResource="<%= BlogsEntry. no code needs to be written in order to have the permission system work for your custom portlet.getCompanyId(). Of course. Resource.class.toString()).4.getName().TYPE_CLASS. Model Permission In order to allow a user to set permissions on the model resources.getPrimaryKey().deleteResource( entry.class. The first one is the <liferay-security:permissionsURL> tag which returns a URL that takes the user to the page to configure the permission settings. Below is an example found in the file view_entry_content. The second tag is the <liferay-ui:icon> tag that shows a permission icon to the user.jsp.

In the blogs portlet example. plid. There’s also an optional attribute redirect that’s available if you want to override the default behavior of the upper right arrow link shown in figure 3. The var attribute is the variable name this URL String will get assigned to. The first one is in the file view_entries. This may be done in a couple of places.2. the blogs title was passed in. you can pass in anything that best describes this model instance.ADD_ENTRY). However.) In the addEntry(…) method. This variable is then passed to the <liferay-ui:icon> tag so the permission icon will have the proper URL link.BLOGS. The presence of the add entry button is contingent on whether the user has permission to add entry (and also whether the user is in tab one). <% boolean showAddEntryButton = tabs1. a calendar event) if the user does not have permission to do so. Checking Portlet Resource Permission Similar to the other steps. In the example. you do need to implement any custom permission you have defined in your resource-actions XML file. For example. The resourcePrimKey attribute is simply the primary key of your model instance. or your user interface should hide a button that adds a model (e. a call is made to check whether the incoming request has permission to add entry. PortletPermission. %> The second place that checks for the add entry permission is in the file BlogsEntryServiceImpl. which is reflected in figure 3. ActionKeys. one custom supported action is ADD_ENTRY. (Notice the difference between this file and the BlogsEntryLocalServiceImpl.1.g.3. PortletKeys.check( 137 .Security and Permissions As for the modelResourceDescription attribute. You do not need to implement anything for your portlet to discriminate whether a user is allowed to view or to configure the portlet itself.equals("entries") && PortletPermission. That is all you need to do to enable users to configure the permission settings for model resources!! Checking Permissions The last major step to implementing permission to your custom portlet is to check permission.jsp.1 with the blue underline.. the default permissions for the portlet resources are automatically checked for you. There are two places in the source code that check for this permission.contains(permissionChecker. your business layer should check for permission before deleting a resource.2.3.

String title. Now that you know what the PermissionChecker does and how to obtain an instance of it. it checks for user permissions. plid. PortletKeys.2). plid. Otherwise. The contains(…) methods are meant to be used in your JSP files since they return a boolean instead of throwing an exception. PermissionChecker The PermissionChecker class has a method called hasPermission(…) that checks whether a user making a resource request has the necessary access permission. (The addEntry(…) method is found in BlogsEntryServiceImpl. int displayDateYear. This class is available to you in two places. int displayDateHour. addCommunityPermissions. If the check fails.Security and Permissions getPermissionChecker(). } Before the addEntry(…) method calls BlogsEntryLocalServiceUtil. If the user is not signed in (guest user).addEntry(…) to add a blogs 138 . you’ll have an instance of the PermissionChecker class available to you via the permissionChecker variable.) public BlogsEntry addEntry( String plid. let’s take a look at Liferay’s convention in using it.4. If your JSP file contains the portlet tag <portlet:defineObjects /> or includes another JSP file that does. int displayDateDay. addGuestPermissions). boolean addGuestPermissions) throws PortalException. First in your business logic layer.addEntry( getUserId(). You’re probably wondering what the PortletPermission class and the PermissionChecker class do. SystemException { PortletPermission. ActionKeys. return BlogsEntryLocalServiceUtil. The check(…) methods are meant to be called in your business layer (ServiceImpl). String categoryId. ActionKeys. Let’s revisit the blogs portlet example below. The other place where you can obtain an instance of the PermissionChecker class is in your JSP files. displayDateHour. categoryId. The two differences between them are: 1. title. 2. tags.ADD_ENTRY). They are all essentially the same. PortletPermission PortletPermission is a helper class that makes it easy for you to check permission on portlet resources (as oppose to model resources. it throws a PrincipalException and the add entry request aborts. The check(…) methods throw a new PrincipalException if user does not have permission. displayDateYear. you can obtain an instance of the PermissionChecker by calling the getPermissionChecker() method inside your ServiceImpl class. plid.check( getPermissionChecker().ADD_ENTRY). content. covered later in section 3. String content. displayDateDay. displayDateMinute. This method is available because all ServiceImpl (not LocalServiceImpl) extends the PrincipalBean class. PortletKeys. int displayDateMinute.BLOGS. int displayDateMonth. Let’s take a look at these two classes. it checks for guest permissions. It has two static methods called check(…) and another two called contains(…). displayDateMonth. and the contains(…) methods return a boolean indicating whether user has permission. Only one check(…) method and one contains(…) method take in the portlet layout ID variable (plid). boolean addCommunityPermissions. String[] tags. which implements the getPermissionChecker() method.BLOGS.

Note the parameters passed into the method. Service vs. SystemException { if (!contains(permissionChecker. a PrincipalException is thrown and an entry will not be added. You’re encouraged to do likewise with your custom portlet names and custom action keys. 139 . Whether you need to pass in a portlet layout ID (plid) depends on whether your custom portlet supports multiple instances. The only major difference is that instead of calling methods found in the PortletPermission class mention previously. and then the ServiceImpl calls these methods via the LocalServiceUtil class after the permission check completes successfully. The plid variable is passed into the method by its caller (most likely from a PortletAction class). each having a separate instance of the message board portlet. This way.ADD_ENTRY is also a static String to indicate the action requiring the permission check. A community may need three separate page layouts. the getPermissionChecker() method is readily available in all ServiceImpl classes. Though in general. String entryId. This custom permission class is similar to the PortletPermission class but is tailored to work with your custom models. permission can be assigned separately in all three instances. Checking Model Resource Permission Checking model resource permission is very similar to checking portlet resource permission. String entryId. entry. it calls PortletPermission. ActionKeys. most portlets won’t need to use the portlet layout ID in relation to the permission system. Let’s take a look at the message board portlet for example. which contains four static methods. we encourage you to model after the PortletPermission class. public class BlogsEntryPermission { public static void check( PermissionChecker permissionChecker. Therefore. Custom Permission Class It is advisable to have a helper class to help check permission on your custom models.check(…) to validate user permission. LocalService Since the ServiceImpl class extends the PrincipalBean class. you need to create your own helper class to assist you in checking permission. While you can implement this class however you like. Again. it has access to information of the current user making the service request. actionId)) { throw new PrincipalException(). Let’s take a look at the BlogsEntryPermission class. If the check fails. actionId)) { throw new PrincipalException(). The next section will detail how this is done.BLOGS is just a static String indicating that the permission check is against the blogs portlet. String actionId) throws PortalException.Security and Permissions entry. Only by using the portlet layout ID will the permission system be able to distinguish the three separate instances of the message board portlet. the ServiceImpl class is the ideal place in your business layer to check user permission. Liferay’s convention is to implement the actual business logic inside the LocalServiceImpl methods. Your PortletAction classes should make calls to ServiceUtil (wrapper to ServiceImpl) guaranteeing that permission is first checked before the request is fulfilled. PortletKeys. SystemException { if (!contains(permissionChecker. BlogsEntry entry. } } public static void check( PermissionChecker permissionChecker. } } public static boolean contains( PermissionChecker permissionChecker. String actionId) throws PortalException. entryId.

return contains(permissionChecker. } } Again. it calls the custom permission helper class to check permission. SystemException { BlogsEntryPermission.class. Instead of having the portletId as one of the parameters.contains(permissionChecker. while the two contains(…) methods can be used in your JSP files.getEntry(entryId). 2. } public static boolean contains( PermissionChecker permissionChecker.getGroupId(). BlogsEntry entry. entryId.getPrimaryKey(). <c:if test="<%= BlogsEntryPermission. String actionId) throws PortalException. As you can see.) Let’s see how this class is used in the blogs portlet code. actionId). the methods in this custom class take in either an entryId or a BlogsEntry object.getName(). ActionKeys. ActionKeys. If this call doesn’t throw an exception.getEntry(entryId).VIEW). (Your custom portlet may choose to use the portlet layout ID if need be.hasPermission( entry. it’s very similar to the PortletPermission class. entry. None of the methods need to receive the portlet layout ID (plid) as a parameter.getEntryId() %>" /> </portlet:renderURL> <liferay-ui:icon image="edit" url="<%= entryURL %>" /> </c:if> 140 . the entry is retrieved and returned to its caller. public BlogsEntry getEntry(String entryId) throws PortalException.toString(). } In the BlogsEntryServiceImpl class is a method called getEntry(…). entry. entry.UPDATE) %>"> <portlet:renderURL windowState="<%= WindowState. return BlogsEntryLocalServiceUtil.MAXIMIZED. Before this method returns the blogs entry object. SystemException { return permissionChecker. BlogsEntry. actionId).check( getPermissionChecker(). The two notable differences are: 1.toString() %>" var="entryURL"> <portlet:param name="struts_action" value="/blogs/edit_entry" /> <portlet:param name="redirect" value="<%= currentURL %>" /> <portlet:param name="entryId" value="<%= entry. SystemException { BlogsEntry entry = BlogsEntryLocalServiceUtil.Security and Permissions String actionId) throws PortalException. the two check(…) methods are meant to be called in your business layer.

userId. There is not a lot that needs to be done for the portlet resource to implement the permission system since Liferay Portal has a lot of that work done for you. Liferay’s permission system has all that provided for you.contains(…) method is called to check whether or not to show the edit button. The short answer is. The third step is to provide an interface for the user to configure permission. etc). community roles. You can call the resetValues(…) method to wipe out old parameters. whether they’re organization / location roles. Liferay checks all the roles the current user has.jsp file. You can call the setValues(…) method to pull in parameters from the request object that your permission checker might need (e.properties for the EXT environment) under the permissions.liferay.checker property. community.g. or user roles. Next step is to implement code to register (or add) any newly created resources such as a BlogsEntry object. Using your own Security System in Liferay Here’s a brief outline of how you can use your own security system in Liferay. Implementing permission into your custom portlet consists of four main steps. and organization / location roles should be implemented in your custom portlet.2.. Two major resources are portlets and Java objects.properties (or portal-ext. Lastly.Security and Permissions In the view_entry_content. nothing needs to be developed specifically for user. this brief section will address that. First step is to define any custom resources and actions. implement code to check permission before returning resources or showing custom features. When the hasUserPermission(…) method is called within the PermissionChecker class. Override the isAdmin(…) method. That’s all there is to it! Summary Let’s review what we’ve just covered. 141 . projected. community roles. Register this new class in portal. You’re now well on your way to implement security to your custom Liferay portlets! For other user guides. • • • • • • Create your own PermissionChecker class that extends Liferay’s PermissionChecker class. • The resource_ table contains all the registered resources outlined in section 3. You mainly focus your efforts on any custom Java objects you’ve built. the BlogsEntryPermission. Database Schema View Reviewing how Liferay stores all the permission information in the database may help you gain a better understanding to the entire permission system. Override the hasUserPermission(…) method and the hasGuestPermission(…) method with your own calls to your permission system. and organization / location roles to work with your custom portlets.com/web/guest/devzone Additional Information Roles If you’re wondering how the Liferay user roles. please visit the Liferay Developer Zone at: http://www.

then the user has access to the resource.Security and Permissions • Every possible secure action that can be done to a resource will result in a row in the permission_ table. • Whether a user has permission to a resource depends on the roles the user has. If those roles or groups contain the needed permissionId in the permissions table (in blue). a BlogsEntry resource may have a row in permission_ for the view action. or the community (groups) and organization the user is in (green tables). 142 . and another for the update action. For example.

Tutorials Portlets Liferay Portal Enterprise builds upon the Portlet API [http://www. <category name="category.HelloWorldPortlet </portlet-class> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> </supports> <portlet-info> <title>Hello World</title> <short-title>Hello World</short-title> <keywords>Hello World</keywords> </portlet-info> <security-role-ref> <role-name>Power User</role-name> </security-role-ref> <security-role-ref> <role-name>User</role-name> </security-role-ref> </portlet> The unique id associated with this portlet is 47.xml.portlet. <portlet> <portlet-name>47</portlet-name> <display-name>Hello World</display-name> <portlet-class> com.xml.liferay. The following are examples from the portlets bundled with Liferay. The roles can be changed at run time via the Admin portlet. 2. Display information for this portlet is found in /portal-web/docroot/WEB-INF/liferay-display.GenericPortlet. This portlet is defined in /portal-web/docroot/WEB-INF/portlet. Additional definitions for this portlet are found in /portal-web/docroot/WEB-INF/liferay-portlet.test"> <portlet id="47" /> 143 . 3. This value can be changed at run time via the Admin portlet. if set to true.xml and makes it possible for users to add this portlet via the personalize pages screen. The title is defined in portlet-info. Users must have either the Power User or User role to access this portlet.jcp. Hello World 1.xml must match the portlet-name value in portlet. See the Mail portlet to better understand this feature. The source of this class shows that it does nothing more than print out Hello World.helloworld.org/en/jsr/detail?id=168] (JSR 168) to provide users with a rich set of portlets. The narrow value. means this portlet will be rendered in the narrow column.portlet.Chapter 8.xml. The struts-path value tells Struts that all requests starting with http://localhost/c/hello_world/* are considered part of this portlet's scope. The HelloWorldPortlet class extends javax. This portlet is viewable by HTML browsers. <portlet id="47" struts-path="hello_world" narrow="true" /> The id value in liferay-portlet. Follow the instructions found in Hot Deploy to learn how to hot deploy external WARs that are not bundled with Liferay.

The value for this key is defined in /portal-ejb/classes/content/Language.gfa.liferay.IFramePortlet</portlet-class> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> <portlet-mode>edit</portlet-mode> </supports> <resource-bundle>com. <portlet> <portlet-name>48</portlet-name> <display-name>IFrame</display-name> <portlet-class>com. the Hello World portlet is available under the category with the name that matches the key category.portlet.test=Test IFrame 1.test.portlet.xml.properties.var2=world</value> </preference> </portlet-preferences> <security-role-ref> <role-name>Power User</role-name> 144 . category.liferay.Tutorials <portlet id="48" /> </category> When a user goes to personalize pages and clicks on a category to choose a portlet. This portlet is defined in /portal-web/docroot/WEB-INF/portlet.StrutsResourceBundle</resource-bundle> <portlet-preferences> <preference> <name>src</name> <value>http://www.org</value> </preference> <preference> <name>auth</name> <value>false</value> </preference> <preference> <name>auth-type</name> <value>basic</value> </preference> <preference> <name>form-method</name> <value>post</value> </preference> <preference> <name>user-name</name> <value></value> </preference> <preference> <name>password</name> <value></value> </preference> <preference> <name>hidden-variables</name> <value>var1=hello.

If using form authentication. The auth value.. If using form authentication.xml. Users must have either the Power User or User role to access this portlet.html] of this class shows that this class prints an IFRAME tag that references an external site. The value for this key is defined in / portal-ejb/classes/content/Language. Basic authentication appends the login information to the URL and form authentication requires a post to the external IFrame application. The form-method value can be set to get or post. See the Mail portlet to better understand this feature. The password value sets the password for authentication.test"> <portlet id="47" /> <portlet id="48" /> </category> When a user goes to personalize pages and clicks on a category to choose a portlet.test=Test 145 . the IFrame portlet is available under the category with the name that matches the key category. The roles can be changed at run time via the Admin portlet. The source [http://content. will attempt to authenticate the user to the external IFrame application.com.properties. The user-name value sets the user name for authentication.liferay. set the password as a key value pair like acme_password=password. If using basic authentication. Additional definitions for this portlet are found in /portal-web/docroot/WEB-INF/liferay-portlet. The title is fetched by StrutsResourceBundle and is configured in / portal-ejb/classes/content/Language.Tutorials </security-role-ref> <security-role-ref> <role-name>User</role-name> </security-role-ref> </portlet> The unique id associated with this portlet is 48.portlet. you just need the password. This is only used if you are using form authentication. The IFramePortlet class extends javax. then you just need to set the user name. The preferences bind the name src with the default value of http://www.com/document/api/portal-ejb/com/liferay/portlet/IFramePortlet. Separate each key and value with a = and each key value pair with a . This portlet is editable and viewable by HTML browsers.portlet.org. If you are using basic authentication. if set to true. javax.test. <category name="category. The authtype value can be set to basic or form. Some forms require certain prepopulated fields in order to proceed with authentication. 2. The hidden-variables value is used for form authentication.title.xml and makes it possible for users to add this portlet via the personalize pages screen.java.48=IFrame 3.xml. <portlet id="48" struts-path="iframe" /> The id value in liferay-portlet. you need to set the user name as a key value pair like acme_login=test@acme. Display information for this portlet is found in /portal-web/docroot/WEB-INF/liferay-display.xml must match the portlet-name value in portlet.properties.gfa. category. The struts-path value tells Struts that all requests starting with http://localhost/c/iframe/* are considered part of this portlet's scope.GenericPortlet. 4.

Tutorials

Calendar
1. This portlet is defined in /portal-web/docroot/WEB-INF/portlet.xml. <portlet> <portlet-name>8</portlet-name> <display-name>Calendar</display-name> <portlet-class>com.liferay.portlet.JSPPortlet</portlet-class> <init-param> <name>view-jsp</name> <value>/portlet/calendar/view.jsp</value> </init-param> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> </supports> <resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle> <security-role-ref> <role-name>Power User</role-name> </security-role-ref> <security-role-ref> <role-name>User</role-name> </security-role-ref> </portlet> The unique id associated with this portlet is 8. The JSPPortlet class extends javax.portlet.GenericPortlet. The source of this class shows that this class looks for the init parameters and forwards to the appropriate JSP depending on the portlet mode. This portlet is viewable by HTML browsers. Users must have either the Power User or User role to access this portlet. The roles can be changed at run time via the Admin portlet. 2. The title is fetched by StrutsResourceBundle and is configured in / portal-ejb/classes/content/Language.properties. javax.portlet.title.8=Calendar 3. Additional definitions for this portlet are found in /portal-web/docroot/WEB-INF/liferay-portlet.xml. <portlet id="8" struts-path="calendar" scheduler-class="com.liferay.portlet.calendar.job.Scheduler" preferences-sharing-type="user" show-portlet-access-denied="true" show-portlet-inactive="true" /> The id value in liferay-portlet.xml must match the portlet-name value in portlet.xml. The struts-path value tells Struts that all requests starting with http://localhost/c/calendar/* are considered part of this portlet's scope. See the Mail portlet to better understand this feature. The scheduler-class value must be a class that implements Scheduler and is called to schedule Quartz jobs for this portlet. The preferences-sharing-type value indicates the preferences sharing type of the portlet. If set to none, preferences are not shared and each page will have its own set of preferences. If set to user, preferences are shared by user if the portlet is in a personal page or by group if the portlet is in a group page. If set to company, preferences are shared across the entire company. The show-portlet-access-denied value, if set to true, means non-permissioned users are shown that they do not have access to the portlet. The default value is set in portal.properties. The show-portlet-inactive value, if set to true, means users are shown that the portlet is inactive (if the portlet is inactive). The default value is set in portal.properties. 146

Tutorials

4.

Display information for this portlet is found in /portal-web/docroot/WEB-INF/liferay-display.xml and makes it possible for users to add this portlet via the personalize pages screen. <category name="category.community"> ... <portlet id="8" /> ... </category> When a user goes to personalize pages and clicks on a category to choose a portlet, the Calendar portlet is available under the category with the name that matches the key category.community. The value for this key is defined in /portal-ejb/classes/content/Language.properties. category.community=Community

Message Boards
1. This portlet is defined in /portal-web/docroot/WEB-INF/portlet.xml. <portlet> <portlet-name>19</portlet-name> <display-name>Message Boards</display-name> <portlet-class>com.liferay.portlet.messageboards.MBPortlet</portlet-class> <init-param> <name>edit-jsp</name> <value>/portlet/message_boards/edit.jsp</value> </init-param> <init-param> <name>view-jsp</name> <value>/portlet/message_boards/view.jsp</value> </init-param> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> <portlet-mode>edit</portlet-mode> </supports> <resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle> <portlet-preferences> <preference> <name>messages-per-page</name> <value>25</value> </preference> </portlet-preferences> <security-role-ref> <role-name>Power User</role-name> </security-role-ref> <security-role-ref> <role-name>User</role-name> </security-role-ref> </portlet> The unique id associated with this portlet is 19. The MBPortlet class extends JSPPortlet. This portlet is editable and viewable by HTML browsers. The preferences bind the name messages-per-page with the default value of 25. Users must have either the Power User or User role to access this portlet. The roles can be changed at run time via the Admin portlet.

147

Tutorials

2.

The title is fetched by StrutsResourceBundle and is configured in / portal-ejb/classes/content/Language.properties. javax.portlet.title.19=Message Boards

3.

Additional definitions for this portlet are found in /portal-web/docroot/WEB-INF/liferay-portlet.xml. <portlet id="19" struts-path="message_boards" indexer-class="com.liferay.portlet.messageboards.util.Indexer" preferences-sharing-type="user" /> The id value in liferay-portlet.xml must match the portlet-name value in portlet.xml. The struts-path value tells Struts that all requests starting with http://localhost/c/message_boards/* are considered part of this portlet's scope. See the Mail portlet to better understand this feature. The indexer-class value must be a class that implements Indexer and is called to create or update a search index for this portlet. The preferences-sharing-type value indicates the preferences sharing type of the portlet. If set to none, preferences are not shared and each page will have its own set of preferences. If set to user, preferences are shared by user if the portlet is in a personal page or by group if the portlet is in a group page. If set to company, preferences are shared across the entire company.

4.

Display information for this portlet is found in /portal-web/docroot/WEB-INF/liferay-display.xml and makes it possible for users to add this portlet via the personalize pages screen. <category name="category.community"> ... <portlet id="19" /> ... </category> When a user goes to personalize pages and clicks on a category to choose a portlet, the Message Boards portlet is available under the category with the name that matches the key category.community. The value for this key is defined in /portal-ejb/classes/content/Language.properties. category.community=Community

Mail
1. This portlet is defined in /portal-web/docroot/WEB-INF/portlet.xml. <portlet> <portlet-name>1</portlet-name> <display-name>Mail</display-name> <portlet-class>com.liferay.portlet.mail.MailPortlet</portlet-class> <init-param> <name>view-jsp</name> <value>/portlet/mail/view.jsp</value> </init-param> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> <portlet-mode>edit</portlet-mode> </supports> 148

Tutorials <resource-bundle>com.portlet.liferay.StrutsResourceBundle</resource-bundle> <portlet-preferences> <preference> <name>html-format</name> <value>true</value> </preference> <preference> <name>forward-address</name> </preference> <preference> <name>signature</name> </preference> <preference> <name>col-order</name> <value>fsdz</value> </preference> <preference> <name>order-by-col</name> <value>d</value> </preference> <preference> <name>order-by-type</name> <value>desc</value> </preference> <preference> <name>messages-per-portlet</name> <value>5</value> </preference> <preference> <name>messages-per-page</name> <value>25</value> </preference> <preference> <name>message-headers</name> <value>1</value> </preference> <preference> <name>include-original</name> <value>true</value> </preference> <preference> <name>original-text-indicator</name> <value>0</value> </preference> <preference> <name>reply-to-address</name> </preference> <preference> <name>new-mail-notification</name> <value>2</value> </preference> <preference> <name>folder-names</name> </preference> <preference> <name>blocked</name> </preference> </portlet-preferences> <security-role-ref> <role-name>Power User</role-name> </security-role-ref> <security-role-ref> 149 .

community=Community 150 . category. if the user requests http://localhost/c/mail/view_folder.xml and makes it possible for users to add this portlet via the personalize pages screen.. Users must have either the Power User or User role to access this portlet.properties.properties. The roles can be changed at run time via the Admin portlet. 2. This portlet is editable and viewable by HTML browsers. Additional definitions for this portlet are found in /portal-web/docroot/WEB-INF/liferay-portlet. <portlet id="1" struts-path="mail" preferences-sharing-type="user" /> The id value in liferay-portlet.PortletConfig.xml.title.portlet. User are not allowed to access any paths that fall in http://localhost/c/mail/* unless the have the required roles to access this portlet. javax.RenderRequest. 4.1=Mail 3. This class has access to the javax.Tutorials <role-name>User</role-name> </security-role-ref> </portlet> The unique id associated with this portlet is 1.xml.xml and / portal-web/docroot/WEB-INF/tiles-defs.portlet. javax.. The title is fetched by StrutsResourceBundle and is configured in / portal-ejb/classes/content/Language. The value for this key is defined in /portal-ejb/classes/content/Language. The struts-path value tells Struts that all requests starting with http://localhost/c/mail/* are considered part of this portlet's scope.community"> .RenderResponse objects through the user's request.xml. Display information for this portlet is found in /portal-web/docroot/WEB-INF/liferay-display. the Mail portlet is available under the category with the name that matches the key category. The MailPortlet class extends JSPPortlet.portlet.community. For example. If a user's request path falls inside the defined struts-path. </category> When a user goes to personalize pages and clicks on a category to choose a portlet. <portlet id="1" /> .. and javax.. <category name="category.portlet. then the user is forwarded to ViewFolderAction. then all of the portlet's objects will be available inside the forwarded Action classes and JSP pages as defined in /portal-web/docroot/WEB-INF/struts-config.xml must match the portlet-name value in portlet. These objects are stored as request attributes with the class names as keys. The JSPs that Struts forward to have access to these objects via the <portlet:defineObjects /> tag.

Chapter 9. Code Conventions We are proud and passionate about super clean code. 151 . follow the precedence of the rest of the code. And ABOVE all else. Wrap lines at 80 spaces and use real tabs equivalent to 4 spaces. Follow the Java Code Conventions and read The Elements of Java Style.

Sign up to vote on this title
UsefulNot useful