Skip to content

Instantly share code, notes, and snippets.

View jardineworks's full-sized avatar

Andrew Jardine jardineworks

View GitHub Profile
@jardineworks
jardineworks / gist:eb9e39290536ef0efd3c
Last active November 1, 2017 22:45
SB + Custom Indexer + Search
---------------------------------------------------------------------------------------------------------
STEP #1: Create new service builder portlet
---------------------------------------------------------------------------------------------------------
1. Project name sample-recipe-portlet
2. Plugin type: Service Builder Portlet
3. Portlet type should be MVCPortlet (at least that is my prefrence)
4.
---------------------------------------------------------------------------------------------------------
@jardineworks
jardineworks / gist:c4e73bfcc770dd17fbc0
Last active June 15, 2020 23:28
dev.life | Parallel Processing
SECTION #0: Introduction and Presentation
=========================================
(use slideshow)
SECTION #1: Creating a "Report Request" portlet plugin
=======================================================
1. Create a new MVC portlet plugin project (in eclipse) called "dev-life-report"
2. Create a new class com.jardineworks.dev.life.liferay.portlet.report.ReportRequestPortlet in the src/main/java folder with the following definition.
<?xml version="1.0"?>
<tomcat-users>
<role rolename="tomcat" />
<role rolename="manager-gui" />
<role rolename="manager-script" />
<role rolename="manager-jmx" />
<role rolename="manager-status" />
<user
password="tomcat"
roles="tomcat,manager-gui,manager-script,manager-jmx,manager-status"
<mirror>
<id>artifactory</id>
<mirrorOf>*</mirrorOf>
<url>http://repository.liferay.com/nexus/content/groups/public>
<name>Liferay</name>
</mirror>
<?xml version="1.0"?>
<tomcat-users>
<role rolename="tomcat" />
<role rolename="manager-gui" />
<role rolename="manager-script" />
<role rolename="manager-jmx" />
<role rolename="manager-status" />
<user
password="tomcat"
roles="tomcat,manager-gui,manager-script,manager-jmx,manager-status"
# Added for Arquillian support
JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=8099 -Dcom.sun.management.jmxremote.ssl=false"
CATALINA_OPTS="${CATALINA_OPTS} ${JMX_OPTS}"
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.5.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
<dependency>
<groupId>com.liferay.arquillian</groupId>
<artifactId>arquillian-liferay-maven-extension</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>1.1.5.Final</version>
</dependency>
package com.ypg.liferay.portlet;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.liferay.counter.service.CounterLocalServiceUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.User;
import com.liferay.portal.service.UserLocalServiceUtil;
@RunWith(Arquillian.class)
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="tomcat" default="true">
<configuration>
<property name="jmxPort">8099</property>
<property name="host">localhost</property>
<property name="httpPort">8080</property>
<property name="user">tomcat</property>
<property name="pass">tomcat</property>