Example usage for com.vaadin.server WrappedPortletSession getPortletSession

List of usage examples for com.vaadin.server WrappedPortletSession getPortletSession

Introduction

In this page you can find the example usage for com.vaadin.server WrappedPortletSession getPortletSession.

Prototype

public PortletSession getPortletSession() 

Source Link

Document

Gets the wrapped PortletSession .

Usage

From source file:de.uni_tuebingen.qbic.qbicmainportlet.QbicmainportletUI.java

License:Open Source License

/**
 * /*from  w w  w .j  a  va 2 s.  c o m*/
 * @return
 */
public PortletSession getPortletSession() {
    UI.getCurrent().getSession().getService();
    VaadinRequest vaadinRequest = VaadinService.getCurrentRequest();
    WrappedPortletSession wrappedPortletSession = (WrappedPortletSession) vaadinRequest.getWrappedSession();
    return wrappedPortletSession.getPortletSession();
}

From source file:fi.csc.pathway.TutkaUI.java

License:Creative Commons License

private String getPortletContextName(VaadinRequest request) {
    WrappedPortletSession wrappedPortletSession = (WrappedPortletSession) request.getWrappedSession();
    PortletSession portletSession = wrappedPortletSession.getPortletSession();

    final PortletContext context = portletSession.getPortletContext();
    final String portletContextName = context.getPortletContextName();
    File f = new File("/opt/avaa/liferay-portal/tomcat/shared/radar.properties");
    Properties prop = new Properties(); // voisi parsia mys suoraan tomcatin configista
    FileInputStream in = null;/*from w  w w .  j  av a2 s  .  c om*/
    try {
        in = new FileInputStream(f);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }
    try {
        prop.load(in);
    } catch (IOException e) {
        e.printStackTrace();
    }
    String portti = prop.getProperty("portti");
    if (null == portti) {
        portti = "8181"; // tomcat
        log.error("Konfiguraation lukuvirhe: portiksi asetettu 8181");
    } //palvelu on kytss ulkopuolle mys portissa 80 (apache)
    String parvo = portti + "/" + portletContextName;
    return parvo;
}