Some ADT examples for Liferay 7.1
sudo nano /etc/systemd/system/liferay.service
Add the following contents (make sure to user your own paths)
[Unit]
Description=Liferay Apache Tomcat Web Application Container
After=network.target
This gist is based on Liferay DXP (7.0) with Tomcat
-
Create
system-ext.properties
in/WEB-INF/classes
-
Add
org.xml.sax.driver=com.sun.org.apache.xerces.internal.parsers.SAXParser
to system-ext.properties -
Create
com.liferay.portal.store.s3.configuration.S3StoreConfiguration.cfg
inosgi/configs
accessKey=
secretKey=
<?xml version="1.0"?> | |
<!-- this workflow will sent data from a simple form (subject and description field) to an external rest service --> | |
<workflow-definition | |
xmlns="urn:liferay.com:liferay-workflow_7.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:liferay.com:liferay-workflow_7.0.0 http://www.liferay.com/dtd/liferay-workflow-definition_7_0_0.xsd"> | |
<name>Logger</name> | |
<description></description> | |
<version>1</version> | |
<state> | |
<name>Start</name> |
The line TemplateResource templateResource = new URLTemplateResource("0",this.getClass().getClassLoader().getResource("personal_alert.ftl"));
will load the template from src/main/resources
package com.liferay.alerter;
import java.io.StringWriter;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
Before following this tutorial, you will need:
-
A Ubuntu 16.04 Droplet set up by following the Initial Server Setup with Ubuntu 16.04, including creating a sudo non-root user.
-
The Oracle JDK 8 installed, which you can do by following the "Installing the Oracle JDK" section of this Java installation article
Except otherwise noted, all of the commands that require root privileges in this tutorial should be run as a non-root user with sudo privileges.
This is my portal-ext configuration to avoid static resources being cached after a new deployment in Liferay DXP. Mainly used for development purpose.
com.liferay.portal.servlet.filters.cache.CacheFilter=false
com.liferay.portal.servlet.filters.etag.ETagFilter=false
com.liferay.portal.servlet.filters.header.HeaderFilter=false
com.liferay.portal.servlet.filters.themepreview.ThemePreviewFilter=true
theme.css.fast.load=false
layout.template.cache.enabled=false
browser.launcher.url=
When setting up Liferay DXP it's necessary to add an smtp-server e.g. for resetting your password. For testing/development purpose it's easier to use a service like mailtrap.io. Simply add the portal-ext.properties with the right settings and you are good to go without spamming your users.