All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.eng.spago.base.RequestContainerPortletAccess Maven / Gradle / Ivy

/**

    Copyright 2004, 2007 Engineering Ingegneria Informatica S.p.A.

    This file is part of Spago.

    Spago is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 2.1 of the License, or
    any later version.

    Spago is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Spago; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

**/
package it.eng.spago.base;

import it.eng.spago.tracing.TracerSingleton;

import javax.portlet.PortletRequest;
import javax.servlet.http.HttpServletRequest;
/**
 * La classe RequestContainerPortletAccess permette di accede all'oggetto
 * RequestContainer all'interno di una portlet

* @version 1.0, 20/01/2005 * @author Daniela Butano * @see BaseContainer * @see ResponseContainer */ public class RequestContainerPortletAccess { /** * Ritorna il RequestContainer il cui riferimento è * memorizzato nell'oggetto RenderRequest request * della richiesta corrente. *

* @param request RenderRequest della richiesta corrente * @return RequestContainer il contenitore dei dati */ private static RequestContainer getRequestContainer(PortletRequest renderRequest) { if (renderRequest == null) { TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.WARNING, "RequestContainerPortletAccess::getRequestContainer: renderRequest nullo"); return null; } // if (renderRequest == null) //**************** START MODFIFICATION ZERBETTO 09-10-2006 **************** //String requestContainerName = (String)renderRequest.getPortletSession().getAttribute(AdapterPortlet.REQUEST_CONTAINER_NAME); ////String requestContainerName = renderRequest.getParameter(Constants.REQUEST_CONTAINER); //if (requestContainerName == null) { // TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.DEBUG, // "RequestContainerPortletAccess::getRequestContainer: requestContainerName nullo"); // return null; //} // if (requestContainerName == null) //RequestContainer requestContainer = (RequestContainer)renderRequest.getPortletSession().getAttribute(requestContainerName); RequestContainer requestContainer = (RequestContainer)renderRequest.getPortletSession().getAttribute(Constants.REQUEST_CONTAINER); //**************** END MODFIFICATION ZERBETTO 09-10-2006 **************** if (requestContainer == null) TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.WARNING, "RequestContainerPortletAccess::getRequestContainer: requestContainer nullo"); return requestContainer; } // public static RequestContainer getRequestContainer(HttpServletRequest request) public static RequestContainer getRequestContainer(HttpServletRequest request) { if (request == null) { TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.WARNING, "RequestContainerPortletAccess::getRequestContainer: request nullo"); return null; } // if (request == null) PortletRequest renderRequest = (PortletRequest)request.getAttribute("javax.portlet.request"); return getRequestContainer(renderRequest); } // public static RequestContainer getRequestContainer(HttpServletRequest request) private static void delRequestContainer(PortletRequest renderRequest) { if (renderRequest == null) { TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.WARNING, "RequestContainerPortletAccess::delRequestContainer: renderRequest nullo"); return; } // if (renderRequest == null) //**************** START MODFIFICATION ZERBETTO 09-10-2006 **************** //String requestContainerName = (String)renderRequest.getPortletSession().getAttribute(AdapterPortlet.REQUEST_CONTAINER_NAME); ////String requestContainerName = renderRequest.getParameter(Constants.REQUEST_CONTAINER); //if (requestContainerName == null) { // TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.DEBUG, // "RequestContainerPortletAccess::delRequestContainer: requestContainerName nullo"); // return; //} // if (requestContainerName == null) //renderRequest.getPortletSession().setAttribute(requestContainerName, null); renderRequest.getPortletSession().setAttribute(Constants.REQUEST_CONTAINER, null); //**************** END MODFIFICATION ZERBETTO 09-10-2006 **************** TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.DEBUG, "RequestContainerPortletAccess::delRequestContainer: requestContainer rimosso"); } // public static void delRequestContainer(HttpServletRequest request) public static void delRequestContainer(HttpServletRequest request) { if (request == null) { TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.WARNING, "RequestContainerPortletAccess::delRequestContainer: request nullo"); return; } // if (request == null) PortletRequest renderRequest = (PortletRequest)request.getAttribute("javax.portlet.request"); delRequestContainer(renderRequest); } // public static void delRequestContainer(HttpServletRequest request) } // public class RequestContainerPortletAccess





© 2015 - 2025 Weber Informatics LLC | Privacy Policy