Package javax.portlet

Examples of javax.portlet.PortletRequest


   */
  public void testGetAttributes() {
    try {
      Map map = null;
      UserInfoAttributesServiceImpl uias = UserInfoAttributesServiceImpl.getInstance(props);
      PortletRequest pr = new MockPortletRequest();
      map = uias.getAttributes(pr);
      String sex = (String)map.get(P3PAttributes.USER_GENDER);
      assertTrue(sex.equals(TEST_USER_GENDER));
      System.out.println("Sex: " + sex);
      String fname = (String)map.get(P3PAttributes.USER_NAME_GIVEN);
View Full Code Here


    {
        ExternalContext externalContext = facesContext.getExternalContext();

        if (PortletUtil.isPortletRequest(facesContext))
        {
            PortletRequest request = (PortletRequest)externalContext.getRequest();
            return request.getParameter(MyFacesGenericPortlet.VIEW_ID);
        }

        String viewId = externalContext.getRequestPathInfo()//getPathInfo
        if (viewId == null)
        {
View Full Code Here

        FacesContext facesContext = currentInstance;
            ExternalContext extContext = facesContext.getExternalContext();
            Object request = extContext.getRequest();
            if (request instanceof PortletRequest) {
          String username = null;
          PortletRequest portletRequest = (PortletRequest)request;
              Map<String,String> userInfo = (Map) portletRequest.getAttribute(PortletRequest.USER_INFO);
              username = (userInfo!=null) ? (String) userInfo.get("user.name") : null;
              if (username == null) {
                  username = portletRequest.getRemoteUser();
              }
             context = new ApplicationGlobalContext();
              if(ProxyManager.getDefaultProxy(username) == null){
                HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
                PrintWriter out = response.getWriter();
View Full Code Here

            Object request = extContext.getRequest();
            if (request instanceof PortletRequest) {
          System.out.println("Portlet instance "
              + facesContext.getExternalContext().getContext());
          String username = null;
          PortletRequest portletRequest = (PortletRequest)request;
              Map userInfo = (Map) portletRequest.getAttribute(PortletRequest.USER_INFO);
              username = (userInfo!=null) ? (String) userInfo.get("user.name") : null;
              if (username == null) {
                  username = portletRequest.getRemoteUser();
              }
              ApplicationGlobalContext context = new ApplicationGlobalContext();
              Application application = facesContext.getApplication();
             
              if(ProxyManager.getDefaultProxy(username) == null){
View Full Code Here

     */
    protected TreeControl getTreeControl() throws JspException {

        Object treeControl = null;
       
        PortletRequest renderRequest = (PortletRequest) pageContext.findAttribute("javax.portlet.request");
        if(PORTLET_REQUEST.equals(scope))
        {
           
            treeControl = renderRequest.getAttribute(tree);
        }
        else if(PORTLET_SESSION.equals(scope))
        {
            treeControl = renderRequest.getPortletSession().getAttribute(tree);
        }
             
        if (treeControl == null)
        {
            treeControl = super.getTreeControl();
View Full Code Here

        }
        else
        {
            if (null == value)
            {
                PortletRequest pr = (PortletRequest) super.getAttribute("javax.portlet.request");
                if (pr != null)
                {
                    value = super.getAttribute(NamespaceMapperAccess.getNamespaceMapper().encode(portletWindow.getId(),
                            name));
                }
View Full Code Here

  public static boolean isPortletRequest(FacesContext facesContext) {
    return PORTLET_API_AVAILABLE && facesContext.getExternalContext().getContext() instanceof PortletContext;
  }

  public static String getViewId(FacesContext facesContext) {
    PortletRequest request = (PortletRequest) facesContext.getExternalContext().getRequest();
    return request.getParameter(PortletUtils.VIEW_ID);
  }
View Full Code Here

    /* (non-Javadoc)
     * @see org.jasig.portal.portlets.swapper.IPersonLookupHelper#getQueryAttributes(org.springframework.webflow.context.ExternalContext)
     */
    public Set<String> getQueryAttributes(ExternalContext externalContext) {
        final PortletRequest portletRequest = (PortletRequest)externalContext.getNativeRequest();
        final PortletPreferences preferences = portletRequest.getPreferences();
       
        final Set<String> queryAttributes;
        final String[] configuredAttributes = preferences.getValues(PERSON_LOOKUP_PERSON_LOOKUP_QUERY_ATTRIBUTES, null);
        final String[] excludedAttributes = preferences.getValues(PERSON_LOOKUP_PERSON_LOOKUP_QUERY_ATTRIBUTES_EXCLUDES, null);

View Full Code Here

       
        for (final Map.Entry<String, Attribute> attrEntry : attributes.entrySet()) {
            queryAttributes.put(attrEntry.getKey(), attrEntry.getValue().getValue());
        }
       
        final PortletRequest portletRequest = (PortletRequest)externalContext.getNativeRequest();
        final PortletPreferences preferences = portletRequest.getPreferences();
        final String[] configuredAttributes = preferences.getValues(PERSON_LOOKUP_PERSON_DETAILS_DETAILS_ATTRIBUTES, null);
        final String[] excludedAttributes = preferences.getValues(PERSON_LOOKUP_PERSON_DETAILS_DETAILS_ATTRIBUTES_EXCLUDES, null);

        //Calculate the Set of attributes that are OK to be searched with
        final Set<String> allowedAttributes = new LinkedHashSet<String>();
View Full Code Here

   
    /* (non-Javadoc)
     * @see org.jasig.portal.portlets.lookup.IPersonLookupHelper#getQueryDisplayResults(org.springframework.webflow.context.ExternalContext, java.util.Collection)
     */
    public Map<IPersonAttributes, String> getQueryDisplayResults(ExternalContext externalContext, Collection<IPersonAttributes> queryResults) {
        final PortletRequest portletRequest = (PortletRequest)externalContext.getNativeRequest();
        final PortletPreferences preferences = portletRequest.getPreferences();
       
        final String[] resultsAttributes = preferences.getValues(PERSON_LOOKUP_PERSON_SEARCH_RESULTS_RESULTS_ATTRIBUTES, null);
        final String resultsMessage = preferences.getValue(PERSON_LOOKUP_PERSON_SEARCH_RESULTS_RESULTS_MESSAGE, null);
       
        final Map<IPersonAttributes, String> displayResults = new LinkedHashMap<IPersonAttributes, String>();
View Full Code Here

TOP

Related Classes of javax.portlet.PortletRequest

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.