Package org.gatein.pc.api

Examples of org.gatein.pc.api.PortletInvokerException


               Portlet delegate = super.getPortlet(PortletContext.createPortletContext(portletState.getPortletId()));
               return new ProducerPortlet(portletContext, delegate);
            }
            catch (StateConversionException e)
            {
               throw new PortletInvokerException(e);
            }
         }
         else
         {
            throw new InvalidPortletIdException("", portletId);
View Full Code Here


                        StateEvent event = new StateEvent(clonedCtx, StateEvent.Type.PORTLET_CLONED_EVENT);
                        instanceCtx.onStateEvent(event);
                     }
                     catch (NoSuchStateException e)
                     {
                        throw new PortletInvokerException("Unexpected exception", e);
                     }
                     catch (InvalidStateIdException e)
                     {
                        throw new PortletInvokerException("Unexpected exception", e);
                     }
                  }
                  else
                  {
                     PortletContext clonedCtx = marshall(stateType, context.getPortletId(), newPrefs);
                     StateEvent event = new StateEvent(clonedCtx, StateEvent.Type.PORTLET_CLONED_EVENT);
                     instanceCtx.onStateEvent(event);
                  }
               }
               else
               {
                  // Add the missing mutable portlet state
                  getPropertiesFromMetaData(portlet.getContext(), newPrefs);

                  //
                  if (persistLocally)
                  {
                     // Create the new state
                     String cloneStateId = persistenceManager.createState(context.getPortletId(), newPrefs);

                     // Return the clone context
                     String cloneId = PRODUCER_CLONE_ID_PREFIX + cloneStateId;
                     PortletContext clonedCtx = PortletContext.createPortletContext(cloneId);
                     StateEvent event = new StateEvent(clonedCtx, StateEvent.Type.PORTLET_CLONED_EVENT);
                     instanceCtx.onStateEvent(event);
                  }
                  else
                  {
                     PortletContext clonedCtx = marshall(stateType, context.getPortletId(), newPrefs);
                     StateEvent event = new StateEvent(clonedCtx, StateEvent.Type.PORTLET_CLONED_EVENT);
                     instanceCtx.onStateEvent(event);
                  }
               }
               break;
            }
            case READ_WRITE:
            {
               StatefulContext statefulContext = (StatefulContext)context;
               if (statefulContext.isLocal())
               {
                  // Update the state
                  try
                  {
                     LocalContext localContext = (LocalContext)statefulContext;
                     String stateId = localContext.getStateId();
                     persistenceManager.updateState(stateId, newPrefs);
                  }
                  catch (NoSuchStateException e)
                  {
                     throw new PortletInvokerException("Unexpected exception", e);
                  }
                  catch (InvalidStateIdException e)
                  {
                     throw new PortletInvokerException("Unexpected exception", e);
                  }
               }
               else
               {
                  PortletContext modifiedCtx = marshall(stateType, context.getPortletId(), newPrefs);
View Full Code Here

         Portlet refPortlet = super.getPortlet(refPortletContext);

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

         //
         getPropertiesFromMetaData(refPortletContext, props);
View Full Code Here

      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();
View Full Code Here

            Serializable marshalledState = stateConverter.marshall(stateType, sstate);
            return StatefulPortletContext.create(portletId, stateType, marshalledState)
         }
         catch (StateConversionException e)
         {
            throw new PortletInvokerException(e);
         }
      }
      else
      {
         if (persistLocally)
         {
            PropertyMap newState = new SimplePropertyMap();
            getPropertiesFromMetaData(originalPortletContext, newState);
            try
            {
               PortletState sstate = new PortletState(portletId, newState);
               Serializable marshalledState = stateConverter.marshall(stateType, sstate);
               return StatefulPortletContext.create(portletId, stateType, marshalledState);
            }
            catch (StateConversionException e)
            {
               throw new PortletInvokerException(e);
            }
         }
         else
         {
            // if we don't have a state associated with this portlet context and we don't persistLocally then there is nothing to
View Full Code Here

            return getPortlet(contextToImport).getContext();
         }
      }
      catch (StateConversionException e)
      {
         throw new PortletInvokerException(e);
      }
   }
View Full Code Here

         S marshalledState = stateConverter.marshall(stateType, sstate);
         return StatefulPortletContext.create(CONSUMER_CLONE_ID, stateType, marshalledState);
      }
      catch (StateConversionException e)
      {
         throw new PortletInvokerException(e);
      }
   }
View Full Code Here

      }

      WSRPPortlet original = getWSRPPortlet(portletContext);
      if (original == null)
      {
         throw new PortletInvokerException("No portlet '" + portletContext.getId() + "' to clone!");
      }

      try
      {
         Holder<String> handle = new Holder<String>();
         Holder<byte[]> portletState = new Holder<byte[]>();
         getPortletManagementService().clonePortlet(getRegistrationContext(),
            WSRPUtils.convertToWSRPPortletContext(portletContext), UserAccess.getUserContext(), null, handle,
            portletState, new Holder<Lifetime>(), new Holder<List<Extension>>()
         );
         return WSRPUtils.convertToPortalPortletContext(handle.value, portletState.value);
      }
      catch (Exception e)
      {
         throw new PortletInvokerException("Couldn't clone portlet '" + portletContext.getId() + "'", e);
      }
   }
View Full Code Here

         return result;
      }
      catch (Exception e)
      {
         throw new PortletInvokerException("Couldn't destroy clones.", e);
      }
   }
View Full Code Here

         throw new IllegalArgumentException(inconsistentParameters);
      }
      catch (InvalidRegistration invalidRegistration)
      {
         handleInvalidRegistrationFault();
         throw new PortletInvokerException(invalidRegistration);
      }
      catch (ModifyRegistrationRequired modifyRegistrationRequired)
      {
         handleModifyRegistrationRequiredFault();
         throw new PortletInvokerException(modifyRegistrationRequired);
      }
      catch (Exception e)
      {
         throw new PortletInvokerException(e);
      }
   }
View Full Code Here

TOP

Related Classes of org.gatein.pc.api.PortletInvokerException

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.