Package org.jboss.portal

Examples of org.jboss.portal.Mode


         //
         StateString navigationalState = renderInvocation.getNavigationalState();
         Map<String, String[]> publicNavigationalState = renderInvocation.getPublicNavigationalState();
         WindowState windowState = renderInvocation.getWindowState();
         Mode mode = renderInvocation.getMode();

         //
         CacheEntry cachedEntry = (CacheEntry)userContext.getAttribute(scopeKey);

         //
         if (cachedEntry != null)
         {
            // Check time validity for fragment
            boolean useEntry = false;
            StateString entryNavigationalState = cachedEntry.navigationalState;
            Map<String, String[]> entryPublicNavigationalState = cachedEntry.publicNavigationalState;

            // Then check nav state equality
            if (navigationalState == null)
            {
               if (entryNavigationalState == null)
               {
                  useEntry = true;
               }
               else if (entryNavigationalState instanceof ParametersStateString)
               {
                  // We consider a parameters state string empty equivalent to a null value
                  useEntry = ((ParametersStateString)entryNavigationalState).getSize() == 0;
               }
            }
            else if (entryNavigationalState == null)
            {
               if (navigationalState instanceof ParametersStateString)
               {
                  useEntry = ((ParametersStateString)navigationalState).getSize() == 0;
               }
            }
            else
            {
               useEntry = navigationalState.equals(entryNavigationalState);
            }

            // Check public nav state equality
            if (useEntry)
            {
               if (publicNavigationalState == null)
               {
                  if (entryPublicNavigationalState == null)
                  {
                     //
                  }
                  else
                  {
                     useEntry = entryPublicNavigationalState.size() == 0;
                  }
               }
               else if (entryPublicNavigationalState == null)
               {
                  useEntry = publicNavigationalState.size() == 0;
               }
               else
               {
                  ParameterMap publicPM = ParameterMap.wrap(publicNavigationalState);
                  ParameterMap entryPM = ParameterMap.wrap(entryPublicNavigationalState);
                  useEntry = publicPM.equals(entryPM);
               }
            }

            // Then check window state equality
            useEntry &= windowState.equals(cachedEntry.windowState);

            // Then check mode equality
            useEntry &= mode.equals(cachedEntry.mode);

            // Clean if it is null
            if (!useEntry)
            {
               cachedEntry = null;
View Full Code Here


      {
         Set tmp = portal.getModes();
         supportedPortletModes = new HashSet(tmp.size());
         for (Iterator i = tmp.iterator(); i.hasNext();)
         {
            Mode mode = (Mode)i.next();
            supportedPortletModes.add(PortletUtils.decodePortletMode(mode.toString()));
         }
      }
      return Tools.toEnumeration(supportedPortletModes.iterator());
   }
View Full Code Here

         //
         for (PortletMode portletMode : portletModes)
         {
            if (portletMode != null)
            {
               Mode mode = Mode.create(portletMode.toString());

               //
               if (preq.supportedModes.contains(mode))
               {
                  responseNextModes.add(mode);
View Full Code Here

//         {
//            throw new IllegalArgumentException("Content type not accepted");
//         }

      //
      Mode currentMode = preq.invocation.getMode();

      org.jboss.portal.common.net.media.MediaType mediaType = org.jboss.portal.common.net.media.MediaType.create(contentType);

      PortletInfo info = preq.container.getInfo();
      CapabilitiesInfo capabilities = info.getCapabilities();
      Set<ModeInfo> compatibleModes = capabilities.getModes(mediaType);
      for (ModeInfo modeInfo : compatibleModes)
      {
         if (currentMode.equals(modeInfo.getMode()))
         {
            // Set the content type
            super.setContentType(contentType);

            //
View Full Code Here

      // Add all the modes
      Set<Mode> modes = new HashSet<Mode>();
      for (ModeInfo modeInfo : capabilities.getModes(si.getMediaType()))
      {
         Mode mode = modeInfo.getMode();

         //
         if (modeInfo instanceof PortletManagedModeInfo || portalContext.getModes().contains(mode))
         {
            modes.add(mode);
View Full Code Here

TOP

Related Classes of org.jboss.portal.Mode

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.