Package org.jboss.portal.portlet

Examples of org.jboss.portal.portlet.InvalidPortletIdException


      {
         throw new IllegalArgumentException();
      }
      if (!wrappedCCP.startsWith(CLONE_ID_PREFIX))
      {
         throw new InvalidPortletIdException(wrappedCCP);
      }
      return PortletContext.createPortletContext(wrappedCCP.substring(CLONE_ID_PREFIX.length()));
   }
View Full Code Here


         {
            throw new NoSuchPortletException(portletId);
         }
         catch (InvalidStateIdException e)
         {
            throw new InvalidPortletIdException(portletId);
         }
      }
      else
      {
         return new ConsumerContext(portletContext, portletContext, null);
View Full Code Here

               throw new PortletInvokerException(e);
            }
         }
         else
         {
            throw new InvalidPortletIdException("", portletId);
         }
      }
      else if (portletId.startsWith(PRODUCER_CLONE_ID_PREFIX))
      {
         try
         {
            String stateId = portletId.substring(PRODUCER_CLONE_ID_PREFIX.length());
            PortletStateContext stateContext = persistenceManager.loadState(stateId);
            PortletState state = stateContext.getState();
            Portlet delegate = super.getPortlet(PortletContext.createPortletContext(state.getPortletId()));
            return new ProducerPortlet(portletContext, delegate);
         }
         catch (NoSuchStateException e)
         {
            throw new NoSuchPortletException(e, portletId);
         }
         catch (InvalidStateIdException e)
         {
            throw new InvalidPortletIdException(e, portletId);
         }
      }
      else
      {
         return super.getPortlet(portletContext);
View Full Code Here

            {
               throw new NoSuchPortletException(e, portletId);
            }
            catch (InvalidStateIdException e)
            {
               throw new InvalidPortletIdException(e, portletId);
            }
         }
         else
         {
            return marshall(statefulContext.getPortletId(), statefulContext.getProperties());
View Full Code Here

      InternalContext context = getStateContext(portletContext);

      //
      if (!context.isStateful())
      {
         throw new InvalidPortletIdException("Cannot configure producer offered portlets", portletId);
      }
      StatefulContext statefulContext = (StatefulContext)context;

      // Get the container
      Portlet referencedPortlet = super.getPortlet(context.getPortletContext());

      // We need the referenced portlet
      if (referencedPortlet == null)
      {
         throw new PortletInvokerException("The portlet " + context.getPortletContext() + " referenced by this clone " + portletId + " is not available");
      }

      // Get the portlet info
      PortletInfo referencedPortletInfo = referencedPortlet.getInfo();

      //
      PreferencesInfo prefs = referencedPortletInfo.getPreferences();

      // Clone the current state
      PropertyMap properties = new SimplePropertyMap(statefulContext.getProperties());

      // Clone argument
      for (PropertyChange change : changes)
      {
         String key = change.getKey();
         int type = change.getType();

         // If the original value exist and is read only we perform a reset instead
         PreferenceInfo pref = prefs.getPreference(key);
         if (pref != null)
         {
            if (Boolean.TRUE.equals(pref.isReadOnly()))
            {
               type = PropertyChange.PREF_RESET;
            }
         }

         //
         if (type == PropertyChange.PREF_UPDATE)
         {
            properties.setProperty(key, change.getValue());
         }
         else
         {
            properties.remove(key);
         }
      }

      //
      if (statefulContext.isLocal())
      {
         LocalContext localContext = (LocalContext)statefulContext;
         String stateId = localContext.getStateId();
         try
         {
            persistenceManager.updateState(stateId, properties);
         }
         catch (NoSuchStateException e)
         {
            throw new NoSuchPortletException(e, portletId);
         }
         catch (InvalidStateIdException e)
         {
            throw new InvalidPortletIdException(e, portletId);
         }
         return PortletContext.createPortletContext(portletId);
      }
      else
      {
View Full Code Here

            {
               throw new NoSuchPortletException(e, portletId);
            }
            catch (InvalidStateIdException e)
            {
               throw new InvalidPortletIdException(e, portletId);
            }
         }
         else
         {
            return new StatelessContext(portletContext.getId());
         }
      }
      else
      {
         try
         {
            final PortletState state = stateConverter.unmarshall(bytes);
            return new RemoteContext(state.getPortletId(), state.getProperties());
         }
         catch (StateConversionException e)
         {
            throw new InvalidPortletIdException(e, portletContext.getId());
         }
      }
   }
View Full Code Here

               throw new PortletInvokerException(e);
            }
         }
         else
         {
            throw new InvalidPortletIdException("", portletId);
         }
      }
      else if (portletId.startsWith(PRODUCER_CLONE_ID_PREFIX))
      {
         try
         {
            String stateId = portletId.substring(PRODUCER_CLONE_ID_PREFIX.length());
            PortletStateContext stateContext = persistenceManager.loadState(stateId);
            PortletState state = stateContext.getState();
            Portlet delegate = super.getPortlet(PortletContext.createPortletContext(state.getPortletId()));
            return new ProducerPortlet(portletContext, delegate);
         }
         catch (NoSuchStateException e)
         {
            throw new NoSuchPortletException(e, portletId);
         }
         catch (InvalidStateIdException e)
         {
            throw new InvalidPortletIdException(e, portletId);
         }
      }
      else
      {
         return super.getPortlet(portletContext);
View Full Code Here

            {
               throw new NoSuchPortletException(e, portletId);
            }
            catch (InvalidStateIdException e)
            {
               throw new InvalidPortletIdException(e, portletId);
            }
         }
         else
         {
            return marshall(statefulContext.getPortletId(), statefulContext.getProperties());
View Full Code Here

      InternalContext context = getStateContext(portletContext);

      //
      if (!context.isStateful())
      {
         throw new InvalidPortletIdException("Cannot configure producer offered portlets", portletId);
      }
      StatefulContext statefulContext = (StatefulContext)context;

      // Get the container
      Portlet referencedPortlet = super.getPortlet(context.getPortletContext());

      // We need the referenced portlet
      if (referencedPortlet == null)
      {
         throw new PortletInvokerException("The portlet " + context.getPortletContext() + " referenced by this clone " + portletId + " is not available");
      }

      // Get the portlet info
      PortletInfo referencedPortletInfo = referencedPortlet.getInfo();

      //
      PreferencesInfo prefs = referencedPortletInfo.getPreferences();

      // Clone the current state
      PropertyMap properties = new SimplePropertyMap(statefulContext.getProperties());

      // Clone argument
      for (PropertyChange change : changes)
      {
         String key = change.getKey();
         int type = change.getType();

         // If the original value exist and is read only we perform a reset instead
         PreferenceInfo pref = prefs.getPreference(key);
         if (pref != null)
         {
            if (Boolean.TRUE.equals(pref.isReadOnly()))
            {
               type = PropertyChange.PREF_RESET;
            }
         }

         //
         if (type == PropertyChange.PREF_UPDATE)
         {
            properties.setProperty(key, change.getValue());
         }
         else
         {
            properties.remove(key);
         }
      }

      //
      if (statefulContext.isLocal())
      {
         LocalContext localContext = (LocalContext)statefulContext;
         String stateId = localContext.getStateId();
         try
         {
            persistenceManager.updateState(stateId, properties);
         }
         catch (NoSuchStateException e)
         {
            throw new NoSuchPortletException(e, portletId);
         }
         catch (InvalidStateIdException e)
         {
            throw new InvalidPortletIdException(e, portletId);
         }
         return PortletContext.createPortletContext(portletId);
      }
      else
      {
View Full Code Here

            {
               throw new NoSuchPortletException(e, portletId);
            }
            catch (InvalidStateIdException e)
            {
               throw new InvalidPortletIdException(e, portletId);
            }
         }
         else
         {
            return new StatelessContext(portletContext.getId());
         }
      }
      else
      {
         try
         {
            final PortletState state = stateConverter.unmarshall(bytes);
            return new RemoteContext(state.getPortletId(), state.getProperties());
         }
         catch (StateConversionException e)
         {
            throw new InvalidPortletIdException(e, portletContext.getId());
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.portal.portlet.InvalidPortletIdException

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.