001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.struts;
016    
017    import javax.portlet.ActionRequest;
018    import javax.portlet.ActionResponse;
019    import javax.portlet.PortletConfig;
020    import javax.portlet.RenderRequest;
021    import javax.portlet.RenderResponse;
022    import javax.portlet.ResourceRequest;
023    import javax.portlet.ResourceResponse;
024    
025    /**
026     * @author Mika Koivisto
027     */
028    public class BaseStrutsPortletAction implements StrutsPortletAction {
029    
030            @Override
031            public boolean isCheckMethodOnProcessAction() {
032                    return _CHECK_METHOD_ON_PROCESS_ACTION;
033            }
034    
035            @Override
036            public void processAction(
037                            PortletConfig portletConfig, ActionRequest actionRequest,
038                            ActionResponse actionResponse)
039                    throws Exception {
040            }
041    
042            @Override
043            public void processAction(
044                            StrutsPortletAction originalStrutsPortletAction,
045                            PortletConfig portletConfig, ActionRequest actionRequest,
046                            ActionResponse actionResponse)
047                    throws Exception {
048    
049                    processAction(portletConfig, actionRequest, actionResponse);
050            }
051    
052            @Override
053            public String render(
054                            PortletConfig portletConfig, RenderRequest renderRequest,
055                            RenderResponse renderResponse)
056                    throws Exception {
057    
058                    return null;
059            }
060    
061            @Override
062            public String render(
063                            StrutsPortletAction originalStrutsPortletAction,
064                            PortletConfig portletConfig, RenderRequest renderRequest,
065                            RenderResponse renderResponse)
066                    throws Exception {
067    
068                    return render(portletConfig, renderRequest, renderResponse);
069            }
070    
071            @Override
072            public void serveResource(
073                            PortletConfig portletConfig, ResourceRequest resourceRequest,
074                            ResourceResponse resourceResponse)
075                    throws Exception {
076            }
077    
078            @Override
079            public void serveResource(
080                            StrutsPortletAction originalStrutsPortletAction,
081                            PortletConfig portletConfig, ResourceRequest resourceRequest,
082                            ResourceResponse resourceResponse)
083                    throws Exception {
084    
085                    serveResource(portletConfig, resourceRequest, resourceResponse);
086            }
087    
088            private static final boolean _CHECK_METHOD_ON_PROCESS_ACTION = true;
089    
090    }