Posts

Showing posts from April, 2021

Liferay JNDI Datasource Configuration

Image
How to configure a JNDI DataSource in Liferay/Tomcat Overview This article explains how to configure a JNDI DataSource and use it in Liferay 7 bundled with Tomcat. Configuration 1. Declare a JNDI Resource in tomcat/conf/server.xml , sample: < Server port ="8005" shutdown ="SHUTDOWN" >  //...  < GlobalNamingResources >    < Resource             name =" jdbc/myDataSource "             auth ="Container"             type ="javax.sql.DataSource"             factory ="org.apache.tomcat.jdbc.pool.DataSourceFactory"             driverClassName ="com.microsoft.sqlserver.jdbc.SQLServerDriver"             url =" jdbc:sqlserver://my-db-url:1433;database=myDB "             username =" test "             password =" test "             maxActive ="20"             maxIdle ="5"             maxWait ="10000"     />  </ GlobalNamingResources >  //... <

Mail Server Configuration in Liferay

Image
Liferay Mail Server Configuration Overview This article explains how to configure a mail server in Liferay 7.x for sending and receiving emails using a Gmail account. Configuration Go to the Control Panel -> System -> Server Administration. Click on the “Mail” tab. Set the following options: Name Value Incoming POP Server pop.gmail.com Incoming Port 995 Use a Secure Network Connection true User Name <your-gmail-account> Password <your-gmail-password> Outgoing SMTP Server smtp.gmail.com Outgoing Port 465 Use a Secure Network Connection true Enable StartTLS true User Name <your-gmail-account> Password <your-gmail-password> Manually specify additional JavaMail properties to override the above configuration. mail.smtp.socketFactory.port: 465 mail.smtp.socketFactory.class:javax.net.ssl.SSLSocketFactory mail.smtp.socketFactory.fallback:false mail.smtp.auth: true Sample: Save the configuration, and that’s it - now you should be able to send and receive emails fro

Display PowerPoint Presentation on a Liferay Page

Image
How to integrate a PowerPoint presentation to a portal page Overview Let’s say, you have a PowerPoint presentation (*.ppt/*.pptx file), and want to display it on a Liferay page. This article shows how to do it in a simple way. Solution 1. Upload PowerPoint presentation to the Document and Media. 2. Copy the generated URL of document, sample: http://liferay-demo.com/documents/20126/81075/My-Presentation.pptx/c1df7c2b-420a-262d-6ead-cb64beec90a9 3. Create a content page to display the presentation. 4. Add an HTML Fragment (or a Basic Web Content) to a page, with the following content: < iframe src ='https://view.officeapps.live.com/op/embed.aspx?src=http://liferay-demo.com/documents/20126/81075/My-Presentation.pptx/c1df7c2b-420a-262d-6ead-cb64beec90a9'         width ='100%' height ='600px' frameborder ='0' > </ iframe >    (adjust the document URL, and iframe options according to your needs) Sample: Enjoy 😏