Package javax.portlet

Examples of javax.portlet.PortletContext


        {
            putRequestVariable(request, "ERRORS", errors);
        }
        request.setAttribute(FrameworkConstants.MODEL_TOOL, model);

        PortletContext context = getPortletContext();
        PortletRequestDispatcher rd = context.getRequestDispatcher(template);
        rd.include(request, response);
    }
View Full Code Here


        boolean bShowInfoPage = false;
        String  cookieValue = null;
       
         // Build the context path
        String contextPath =    request.getContextPath();
        PortletContext portletApplication = getPortletContext();
        String path = portletApplication.getRealPath("/WEB-INF");
        String rootContextPath = path + "/";
       
        /*
         * At this point we have all the information to run the PHP servlet:
         *     rootContextPath  contains the file path to the PortletApplication root (e.g /home/user/tomcat/webapps/MyApplication/ )
View Full Code Here

            }
        }

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

            }
        }

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

            }
        }

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

            }         
        }

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

      }
     
      // Open the perl script and extract the perl executable path. It's the same way as apache HTTP executes PERL
      String perlExecutable = null;
     
       PortletContext portletApplication = getPortletContext();
        String path = portletApplication.getRealPath("/WEB-INF");
        String contextPath = path + "/";
        String fullScriptPath = contextPath + scriptPath;
   
      // Build full path to scripts
View Full Code Here

    //TODO: Should we throw an exception if the bridge is already initialized?
    if (mInitialized)
      throw new BridgeException("Bridge already initialized.");
   
    mPortletConfig = config;
    PortletContext portletContext = mPortletConfig.getPortletContext();

    // get preserveActionParams and excludedAttributes configuration settings.
    mPreserveActionParams = (Boolean) portletContext.getAttribute(Bridge.BRIDGE_PACKAGE_PREFIX + mPortletConfig.getPortletName() +
                                            "." + Bridge.PRESERVE_ACTION_PARAMS);
   
    mExcludedRequestAttributes = (List <String>) portletContext.getAttribute(Bridge.BRIDGE_PACKAGE_PREFIX + mPortletConfig.getPortletName() +
                                            "." + Bridge.EXCLUDED_REQUEST_ATTRIBUTES);
    if (mExcludedRequestAttributes != null)
    {
      // copy the list as we may be adding to it and don't want to worry that this might be immutable
      mExcludedRequestAttributes = new ArrayList(mExcludedRequestAttributes);    
    }
    else
    {
      // Otherwise create an empty list
      mExcludedRequestAttributes = new ArrayList(5);
    }
  
    // Read excludedAttributes that may be defined in any face-config.xml
    readExcludedAttributesFromFacesConfig(portletContext, mExcludedRequestAttributes);

    // Set up the synchronziation object for the RequestScopeMap as we don't
    // want to sync on the PortletContext because its too broad. Note:
    // needed
    // because we not only need to sync the Map but also creating the Map
    // and
    // putting it in the PortletContext. Hence the sync object allows us
    // to limit syncronizing the PortletContext to once per portlet (init
    // time);
   
    // TODO: What about synching on a static object or using a class lock?
    //       Perhaps even the LRUMap itself if said map is a singleton?
    synchronized (portletContext)
    {
      Object lock = portletContext.getAttribute(REQUEST_SCOPE_LOCK);
      if (lock == null)
      {
        portletContext.setAttribute(REQUEST_SCOPE_LOCK, new Object());
      }
    }

    // Add self as ELContextListener to the Faces App so we can add the
    // portletConfig to any newly created contexts.
View Full Code Here

  }
 
  private void dumpScopeId(String scopeId, String phase)
  {
    // Get the data from the scope
    PortletContext ctx = mPortletConfig.getPortletContext();
    ctx.log("dumpScopeId: " + phase);
    synchronized (ctx.getAttribute(REQUEST_SCOPE_LOCK))
    {
      // get the managedScopeMap
      LRUMap requestScopeMap = (LRUMap) ctx.getAttribute(REQUEST_SCOPE_MAP);
      // No scope for all renders before first action to this portletApp
      if (requestScopeMap == null)
      {
        ctx.log("There are No saved scoped.  Can't match: "+ scopeId);
        return;
      }

      Map<String, Object> m = requestScopeMap.get(scopeId);
      if (m == null)
      {
        ctx.log("Can't match scope: "+ scopeId);
        return;
      }
     
      Set<Map.Entry<String,Object>> set = m.entrySet();
      Iterator<Map.Entry<String,Object>> i = set.iterator();
      ctx.log("Elements in scope: " + scopeId);
      while (i.hasNext())
      {
        Map.Entry<String,Object> entry = i.next();
        ctx.log("     " + entry.getKey());
      }
      ctx.log("end dumpScopeId");
    }
      
  }
View Full Code Here

  private void updateViewInfo(
    FacesContext context,
    String scopeId,
    boolean redirectedDuringRender)
  {
    PortletContext portletContext = mPortletConfig.getPortletContext();

    // Get the request scope lock -- because its added during init it should
    // always be there.
    synchronized (portletContext.getAttribute(REQUEST_SCOPE_LOCK))
    {
      // get the managedScopeMap
      LRUMap requestScopeMap = (LRUMap) portletContext.getAttribute(REQUEST_SCOPE_MAP);

      if (requestScopeMap == null)
      {
        // Have only done renders to this point -- so no scope to update
        return;
View Full Code Here

TOP

Related Classes of javax.portlet.PortletContext

Copyright © 2018 www.massapicom. 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.