1
19
20 package com.liferay.portlet.randombibleverse;
21
22 import com.liferay.portal.kernel.servlet.SessionMessages;
23 import com.liferay.portal.kernel.util.Constants;
24 import com.liferay.portal.kernel.util.ParamUtil;
25 import com.liferay.util.bridges.jsp.JSPPortlet;
26
27 import java.io.IOException;
28
29 import javax.portlet.ActionRequest;
30 import javax.portlet.ActionResponse;
31 import javax.portlet.PortletException;
32 import javax.portlet.PortletMode;
33 import javax.portlet.PortletPreferences;
34
35
41 public class RBVPortlet extends JSPPortlet {
42
43 public void processAction(
44 ActionRequest actionRequest, ActionResponse actionResponse)
45 throws IOException, PortletException {
46
47 if (actionRequest.getPortletMode().equals(PortletMode.EDIT)) {
48 String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
49
50 if (cmd.equals(Constants.UPDATE)) {
51 String language = ParamUtil.getString(
52 actionRequest, "language");
53
54 PortletPreferences prefs = actionRequest.getPreferences();
55
56 prefs.setValue("language", language);
57
58 prefs.store();
59
60 SessionMessages.add(
61 actionRequest,
62 getPortletConfig().getPortletName() + ".doEdit");
63 }
64 }
65 }
66
67 }