Package javax.portlet

Examples of javax.portlet.PortletMode


             */
            WindowState state = new WindowState(getWindowStateOrDefault(navResponse));
            setNextState(uiPortlet, state);

            // update the portlet with the next mode to display
            PortletMode mode = new PortletMode(getPortletModeOrDefault(navResponse));
            setNextMode(uiPortlet, mode);

            StateString navState = navResponse.getNavigationalState();
            if (navState != null) {
                uiPortlet.setNavigationalState(navResponse.getNavigationalState());
View Full Code Here


            // update the portlet with the next mode to display
            // Note: we should only update the Mode if the UpdateNavigationalStateResponse.getMode is not null,
            // otherwise it means the mode has not changed and we should use the current value.
            if (navStateResponse.getMode() != null) {
                PortletMode mode = new PortletMode(getPortletModeOrDefault(navStateResponse));
                setNextMode(uiPortlet, mode);
            }

            /*
             * Cache the render parameters in the UI portlet component to handle the navigational state. Each time a portlet is
View Full Code Here

            } else if (portletMode.equals(PortletMode.EDIT.toString())) {
                uiPortlet.setCurrentPortletMode(PortletMode.EDIT);
            } else if (portletMode.equals(PortletMode.VIEW.toString())) {
                uiPortlet.setCurrentPortletMode(PortletMode.VIEW);
            } else {
                PortletMode customMode = new PortletMode(portletMode);
                uiPortlet.setCurrentPortletMode(customMode);
            }
            event.getRequestContext().addUIComponentToUpdateByAjax(uiPortlet);
        }
View Full Code Here

 
  public void render(RenderRequest request, RenderResponse response)
      throws PortletException, IOException {

    PortletSession session = request.getPortletSession();
    PortletMode mode = (PortletMode) session
        .getAttribute("CurrentPortletMode");

    if (mode == null) {
      mode = request.getPortletMode();
    }
View Full Code Here

        Iterator modes = propertyService.getSupportedPortletModes().iterator();
        while (modes.hasNext())
        {
            String mode = (String) modes.next();
            LOG.debug("Loading mode [" + mode + "]");
            supportedPortletModesByPortal.add(new PortletMode(mode));
        }
        LOG.debug("Loaded [" + supportedPortletModesByPortal.size() + "] supported portal modes");

    }
View Full Code Here

                    } else
                    {
                        Iterator<String> pd = sd.getPortletModes().iterator();
                        while (pd.hasNext())
                        {
                            modeSet.add(new PortletMode(pd.next()));
                        }
                    }
                }
            }
        }
View Full Code Here

                || isPortletManagedMode(portletId, mode));
    }

    public boolean isPortletModeSupportedByPortal(String mode)
    {
        return supportedPortletModesByPortal.contains(new PortletMode(mode));
    }
View Full Code Here

                servletContext.getAttribute(AttributeKeys.PORTLET_CONTAINER);
       
        // Create the portlet window to render.
        PortletWindow window = new PortletWindowImpl(container, windowConfig, requestedPortalUrl);
   
    PortletMode currentMode = requestedPortalUrl.getPortletMode(window.getId().getStringId());

        //start the markup
        StringBuffer tag = new StringBuffer();
//        String strCurrentMode = currentMode.toString();       
//        tag.append("Current mode: " + currentMode.toString());
        tag.append("<form action=\"\" name=\"modeSelectionForm\" style=\"display:inline\"><select onchange=\"self.location=this.options[this.selectedIndex].value\">");
        Set<PortletMode> modeSet = null;
    try {
      modeSet = driverConfig.getSupportedPortletModes(evaluatedPortletId);
    } catch (PortletContainerException e) {
            throw new JspException(e);
    }
   
    if (modeSet != null) {
          Iterator<PortletMode> i = modeSet.iterator();
          while (i.hasNext()) {
            PortletMode mode = i.next();
 
              PortalURL portalUrl =  portalEnv.createPortalURL();
              portalUrl.setPortletMode(evaluatedPortletId, mode);
 
              // Build a string buffer containing the anchor tag
              tag.append("<option value=\"" + portalUrl.toString() + "\"");
              //Add 'selected' attribute for current mode.
              if (mode.equals(currentMode)) {
                tag.append(" selected=\"true\"");
              }
              tag.append(">");
              if (driverConfig.isPortletManagedMode(evaluatedPortletId, mode.toString())) {
                tag.append(getCustomModeDecorationName(driverConfig, mode));               
              } else {
                tag.append(mode.toString().toUpperCase());
              }
//              tag.append(mode.toString().toUpperCase());
              tag.append("</option>");
          }
    }
View Full Code Here

   * Détermine si le mode passé en paramètre est autorisé pour le portlet
   * @param mode à tester
   * @return vrai si le mode est autorisé
   */
  public boolean isPortletModeAllowed(String mode) {
    return isPortletModeAllowed(new PortletMode(mode));
  }
View Full Code Here

  public int doStartTag() throws JspException {

    portletURL = getPortletURL();
    try {
      if (portletMode!=null)
        portletURL.setPortletMode(new PortletMode(portletMode));
    } catch (PortletModeException pme) { }
   
    try {
      if (windowState!=null)
        portletURL.setWindowState(new WindowState(windowState));
View Full Code Here

TOP

Related Classes of javax.portlet.PortletMode

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.