Examples of PortletContext


Examples of javax.portlet.PortletContext

    protected PageManager pageManager;   

    public void init(PortletConfig config) throws PortletException
    {
        super.init(config);
        PortletContext context = getPortletContext();
        spacesService = (Spaces) context.getAttribute(CommonPortletServices.CPS_SPACES_SERVICE);
        if (spacesService == null)
                throw new PortletException(
                        "Could not get instance of portal spaces service component");
        admin = (PortalAdministration) getPortletContext().getAttribute(
                CommonPortletServices.CPS_PORTAL_ADMINISTRATION);
        if (null == admin) { throw new PortletException(
                "Failed to find the Portal Administration on portlet initialization"); }
        pageManager = (PageManager)context.getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
        if (null == pageManager)
        {
            throw new PortletException("Failed to find the Page Manager on portlet initialization");
        }                      
    }
View Full Code Here

Examples of javax.portlet.PortletContext

   
    @Override
    public void init(PortletConfig config) throws PortletException
    {
        super.init(config);
        PortletContext context = getPortletContext();
       
        spacesService = (Spaces) context.getAttribute(CommonPortletServices.CPS_SPACES_SERVICE);
        if (spacesService == null)
        {
            throw new PortletException("Could not get instance of portal spaces service component");
        }
       
        admin = (PortalAdministration) context.getAttribute(CommonPortletServices.CPS_PORTAL_ADMINISTRATION);
        if (admin == null)
        {
            throw new PortletException("Failed to find the Portal Administration on portlet initialization");
        }
    }
View Full Code Here

Examples of javax.portlet.PortletContext

    {
        super.init(config);
       
        configPage = config.getInitParameter("ConfigPage");
       
        PortletContext context = getPortletContext();
       
        pageManager = (PageManager) context.getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
       
        if (pageManager == null)
        {
            throw new PortletException("Could not get instance of pageManager component");
        }
       
        pageLayoutComponent = (PageLayoutComponent) context.getAttribute(CommonPortletServices.CPS_PAGE_LAYOUT_COMPONENT);
       
        if (pageLayoutComponent == null)
        {
            throw new PortletException("Could not get instance of pageLayoutComponent");
        }
View Full Code Here

Examples of javax.portlet.PortletContext

            }
        }
       
        if (previewPage != null)
        {
            PortletContext context = getPortletContext();
            PortletRequestDispatcher rd = context.getRequestDispatcher(previewPage);
            rd.include(request, response);
        }
       
        return;
    }
View Full Code Here

Examples of javax.portlet.PortletContext

    /* (non-Javadoc)
     * @see javax.portlet.GenericPortlet#doView(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
     */
    protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
    {
        PortletContext context = getPortletContext();

        Locale locale = request.getLocale();
        if (locale == null)
        {
            locale = Locale.getDefault();
        }
        request.setAttribute("currentLocale", locale.toString());

        PortletRequestDispatcher rd = context.getRequestDispatcher("/WEB-INF/view/locale-list.jsp");
        rd.include(request, response);
    }
View Full Code Here

Examples of javax.portlet.PortletContext

     * @see org.apache.portals.bridges.velocity.GenericVelocityPortlet#init(javax.portlet.PortletConfig)
     */
    public void init(PortletConfig config) throws PortletException
    {
        super.init(config);
        PortletContext context = getPortletContext();
        trackingManager = (PortletTrackingManager)context.getAttribute(CommonPortletServices.CPS_PORTLET_TRACKING_MANAGER);
    }
View Full Code Here

Examples of javax.portlet.PortletContext

    static final Logger logger = LoggerFactory.getLogger(StatisticsPortlet.class);

    public void init(PortletConfig config) throws PortletException
    {
        super.init(config);
        PortletContext context = getPortletContext();
        statistics = (PortalStatistics) context
                .getAttribute(CommonPortletServices.CPS_PORTAL_STATISTICS);
        if (statistics == null)
                throw new PortletException(
                        "Could not get instance of portal statistics component");
    }
View Full Code Here

Examples of javax.portlet.PortletContext

        return getPortletContext().getMimeType(resourceName);
    }

    @Override
    public File getBaseDirectory() {
        PortletContext context = getPortletContext();
        String resultPath = context.getRealPath("/");
        if (resultPath != null) {
            return new File(resultPath);
        } else {
            try {
                final URL url = context.getResource("/");
                return new File(url.getFile());
            } catch (final Exception e) {
                // FIXME: Handle exception
                getLogger()
                        .log(Level.INFO,
View Full Code Here

Examples of javax.portlet.PortletContext

    @Override
    public InputStream getThemeResourceAsStream(UI uI, String themeName,
            String resource) {
        VaadinPortletSession session = (VaadinPortletSession) uI.getSession();
        PortletContext portletContext = session.getPortletSession()
                .getPortletContext();
        return portletContext.getResourceAsStream("/"
                + VaadinPortlet.THEME_DIR_PATH + '/' + themeName + "/"
                + resource);
    }
View Full Code Here

Examples of javax.portlet.PortletContext

        }
    }

    public void init(PortletConfig portletConfig) throws PortletException {
        super.init(portletConfig);
        PortletContext pc = portletConfig.getPortletContext();
        normalView = pc
                .getRequestDispatcher("/WEB-INF/view/securityrealmmanager/se/users/normal.jsp");
        addNormalView = pc
                .getRequestDispatcher("/WEB-INF/view/securityrealmmanager/se/users/addnormal.jsp");
        maximizedView = pc
                .getRequestDispatcher("/WEB-INF/view/securityrealmmanager/se/users/maximized.jsp");
        addMaximizedView = pc
                .getRequestDispatcher("/WEB-INF/view/securityrealmmanager/se/users/addmaximized.jsp");
        helpView = pc
                .getRequestDispatcher("/WEB-INF/view/securityrealmmanager/se/users/help.jsp");
        errorView = pc
                .getRequestDispatcher("/WEB-INF/view/securityrealmmanager/derby/groups/error.jsp");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.