This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void render(RenderRequest request, RenderResponse response) | |
throws PortletException, IOException { | |
_log.info(" This is render method of PhaseAndLifecyclePortlet"); | |
super.render(request, response); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.opensource.techblog.portlet; | |
import javax.portlet.PortletConfig; | |
import javax.portlet.PortletException; | |
import com.liferay.portal.kernel.log.Log; | |
import com.liferay.portal.kernel.log.LogFactoryUtil; | |
import com.liferay.util.bridges.mvc.MVCPortlet; | |
public class PhaseAndLifecyclePortlet extends MVCPortlet { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@include file="/html/configuration/init.jsp"%> | |
<% | |
String greeting = portletPreferences.getValue("greeting", StringPool.BLANK); | |
%> | |
<%= greeting %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { | |
super.processAction(portletConfig, actionRequest, actionResponse); | |
// Get current preference of portlet | |
String portletResource = ParamUtil.getString(actionRequest, "portletResource"); | |
PortletPreferences preferences = PortletPreferencesFactoryUtil.getPortletSetup(actionRequest, portletResource); | |
// Get value of parameter(s) | |
String greeting = ParamUtil.getString(actionRequest, "greeting"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@include file="/html/configuration/init.jsp"%> | |
<% | |
String greeting = portletPreferences.getValue("greeting", "Hello"); | |
%> | |
<liferay-portlet:actionURL portletConfiguration="true" var="configurationURL"> | |
</liferay-portlet:actionURL> | |
<aui:form action="<%= configurationURL %>" method="POST" name="fm_config"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.blogspot.chingovan; | |
import javax.portlet.ActionRequest; | |
import javax.portlet.ActionResponse; | |
import javax.portlet.PortletConfig; | |
import javax.portlet.RenderRequest; | |
import javax.portlet.RenderResponse; | |
import com.liferay.portal.kernel.portlet.DefaultConfigurationAction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.2.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_2_0.dtd"> | |
<liferay-portlet-app> | |
<portlet> | |
<portlet-name>configuration</portlet-name> | |
<icon>/icon.png</icon> | |
<configuration-action-class>com.blogspot.chingovan.CustomConfigurationAction</configuration-action-class> | |
<header-portlet-css>/css/main.css</header-portlet-css> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void sendEmail(ActionRequest actionRequest, ActionResponse actionResponse) { | |
String email = ParamUtil.getString(actionRequest, "email"); | |
String subject = ParamUtil.getString(actionRequest, "subject"); | |
String content = ParamUtil.getString(actionRequest, "content"); | |
System.out.println("Sending to " + email); | |
System.out.println("Subject: " + subject); System.out.println("Content: " + content); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void sendEmail(ActionRequest actionRequest, ActionResponse actionResponse) { | |
String email = ParamUtil.getString(actionRequest, "email"); | |
String subject = ParamUtil.getString(actionRequest, "subject"); | |
String content = ParamUtil.getString(actionRequest, "content"); | |
System.out.println("Sending to " + email); | |
System.out.println("Subject: " + subject); | |
System.out.println("Content: " + content); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> | |
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> | |
<portlet:defineObjects /> | |
<portlet:actionURL var="sendEmailURL" name="sendEmail"> | |
</portlet:actionURL> | |
<aui:form action="<%= sendEmailURL %>" method="post"> | |
<aui:input label="Email" name="email" type="text" value="" /> |