Package org.gatein.wsrp

Examples of org.gatein.wsrp.WSRPConsumer


      {
         String id = attrs.getValue("id");
         ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "producer identifier", "Configuring a producer");

         // check that the consumer doesn't exist in the database first
         WSRPConsumer consumer = consumerRegistry.getConsumer(id);
         if (consumer != null)
         {
            String message = "Added consumer for producer '" + id + "' with status: ";

            // if consumer is active, add it to the list of services
            if (consumer.getProducerInfo().isActive())
            {
               consumers.put(id, consumer);
               message += "active";
            }
            else
View Full Code Here


      {
         throw new IllegalArgumentException("Trying to use a ConsumerRegistry already linked to a different FederatingPortletInvoker ("
            + registryInvoker + ") than the specified one (" + callingInvoker + ")");
      }

      WSRPConsumer consumer = consumerRegistry.getConsumer(invokerId);

      if (consumer == null)
      {
         // if there's no consumer with that invoker id, then there's nothing much we can do
         if (compoundPortletId != null)
View Full Code Here

         boolean activate = Boolean.valueOf(beanContext.getParameter("activate"));
         try
         {
            if (activate)
            {
               WSRPConsumer consumer = getSelectedConsumer();
               if (consumer.isRefreshNeeded())
               {
                  // refresh the consumer
                  RefreshResult result = internalRefresh(consumer);
                  if (result != null && !result.hasIssues())
                  {
View Full Code Here

   public String update()
   {
      try
      {
         WSRPConsumer consumer = getUpdatedConsumer();

         if (consumer != null)
         {
            beanContext.createInfoMessage(UPDATE_SUCCESS);
         }
View Full Code Here

      return "confirmEraseRegistration";
   }

   private WSRPConsumer getUpdatedConsumer()
   {
      WSRPConsumer consumer = getConsumer();
      if (consumer != null)
      {
         if (isModified())
         {
            // update values
View Full Code Here

      modified = false;
   }

   public String refreshConsumer()
   {
      final WSRPConsumer consumer = getUpdatedConsumer();
      if (consumer != null)
      {
         // if the registration is locally modified, bypass the refresh as it will not yield a proper result
         if (!isRegistrationLocallyModified())
         {
View Full Code Here

   {
      try
      {
         if (portletHandles == null)
         {
            final WSRPConsumer consumer = getConsumer();
            Map<String, Portlet> portlets = consumer.getProducerInfo().getAllPortletsMap();
            List<SelectablePortletHandle> selectableHandles = Collections.emptyList();
            if (ParameterValidation.existsAndIsNotEmpty(portlets))
            {
               selectableHandles = new ArrayList<SelectablePortletHandle>(portlets.size());
               for (Map.Entry<String, Portlet> portlet : portlets.entrySet())
               {
                  final String key = portlet.getKey();
                  final String id = portlet.getValue().getContext().getId();
                  final String display = id.equals(key) ? key : id + " cloned as " + key;

                  selectableHandles.add(new SelectablePortletHandle(key, consumer.getMigrationService().getStructureProvider(), display));
               }
            }
            Collections.sort(selectableHandles);
            portletHandles = new ListDataModel(selectableHandles);
         }
View Full Code Here

      return false;
   }

   public String exportPortlets()
   {
      final WSRPConsumer consumer = getConsumer();
      if (consumer != null)
      {
         List<SelectablePortletHandle> handles = (List<SelectablePortletHandle>)getPortlets().getWrappedData();
         List<String> selectedHandles = new ArrayList<String>(handles.size());
         for (SelectablePortletHandle selectablePortletHandle : handles)
         {
            if (selectablePortletHandle.isSelected())
            {
               selectedHandles.add(selectablePortletHandle.getHandle());
            }
         }

         try
         {
            setCurrentExport(new ExportInfoDisplay(consumer.exportPortlets(selectedHandles), beanContext.getLocale(), consumer.getMigrationService().getStructureProvider()));
         }
         catch (Exception e)
         {
            beanContext.createErrorMessageFrom(e);
            return null;
View Full Code Here

            {
               portletsToImport.add(exportedPortlet);
            }
         }

         final WSRPConsumer consumer = getConsumer();
         ImportInfo info = consumer.importPortlets(currentExport.getExport(), WSRPUtils.transform(portletsToImport, SELECTABLE_TO_HANDLE));

         ConsumerStructureProvider structureProvider = consumer.getMigrationService().getStructureProvider();
         int importCount = 0;
         for (SelectablePortletHandle importedPortlet : portletsToImport)
         {
            String handle = importedPortlet.getHandle();
            PortletContext portletContext = info.getPortletContextFor(handle);
View Full Code Here

   }

   public String deleteExport()
   {
      ExportInfo export = getCurrentExport().getExport();
      final WSRPConsumer consumer = getConsumer();
      if (consumer.getMigrationService().remove(export).equals(export))
      {
         // release the export on the producer
         try
         {
            consumer.releaseExport(export);
         }
         catch (PortletInvokerException e)
         {
            // re-add export to migration service
            consumer.getMigrationService().add(export);

            beanContext.createErrorMessageFrom(e);
            return null;
         }
View Full Code Here

TOP

Related Classes of org.gatein.wsrp.WSRPConsumer

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.