Package org.gatein.pc.api.info

Examples of org.gatein.pc.api.info.PortletInfo


      if (displayName == null)
      {
         org.gatein.pc.api.Portlet portlet = getProducedOfferedPortlet();
         if (portlet != null)
         {
            PortletInfo info = portlet.getInfo();
            MetaInfo meta = info.getMeta();
            displayName = meta.getMetaValue(MetaInfo.DISPLAY_NAME);
            String value = null;
            if (displayName != null)
            {
               RequestContext i = PortalRequestContext.getCurrentInstance();
               Locale locale = i.getLocale();
               value = displayName.getString(locale, true);
            }
            if (value == null || value.length() == 0)
            {
               value = info.getName();
            }
            return value;
         }
         else
         {
            return "";
         }
      }
      else
      {
         String value = null;
         if (displayName != null)
         {
            RequestContext i = PortalRequestContext.getCurrentInstance();
            Locale locale = i.getLocale();
            value = displayName.getString(locale, true);
         }
         if (value == null || value.length() == 0)
         {
            org.gatein.pc.api.Portlet portlet = getProducedOfferedPortlet();
            PortletInfo info = portlet.getInfo();
            value = info.getName();
         }
         return value;
      }
   }
View Full Code Here


      Portlet portlet = uiPortlet.getProducedOfferedPortlet();
      if (portlet == null || portlet.getInfo() == null)
         return;

      PortletInfo portletInfo = portlet.getInfo();

      /*
       * Define which portlet modes the portlet supports and hence should be shown
       * in the portlet info bar
       */
      Set<ModeInfo> modes = portletInfo.getCapabilities().getModes(MediaType.create("text/html"));
      List<String> supportModes = new ArrayList<String>();
      for (ModeInfo modeInfo : modes)
      {
         String modeName = modeInfo.getModeName().toLowerCase();
         if ("config".equals(modeInfo.getModeName()))
View Full Code Here

     */
    public String getDisplayName() {
        if (displayName == null) {
            org.gatein.pc.api.Portlet portlet = getProducedOfferedPortlet();
            if (portlet != null) {
                PortletInfo info = portlet.getInfo();
                MetaInfo meta = info.getMeta();
                displayName = meta.getMetaValue(MetaInfo.DISPLAY_NAME);
                String value = null;
                if (displayName != null) {
                    RequestContext i = PortalRequestContext.getCurrentInstance();
                    Locale locale = i.getLocale();
                    value = displayName.getString(locale, true);
                }
                if (value == null || value.length() == 0) {
                    value = info.getName();
                }
                return value;
            } else {
                return "";
            }
        } else {
            RequestContext i = PortalRequestContext.getCurrentInstance();
            Locale locale = i.getLocale();
            String value = displayName.getString(locale, true);

            if (ParameterValidation.isNullOrEmpty(value)) {
                org.gatein.pc.api.Portlet portlet = getProducedOfferedPortlet();
                PortletInfo info = portlet.getInfo();
                value = info.getName();
            }

            return value;
        }
    }
View Full Code Here

      {
         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
View Full Code Here

      {
         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
View Full Code Here

            {
               ManagedObjectLifeCycleEvent lifeCycleEvent = (ManagedObjectLifeCycleEvent)managedObjectEvent;
               LifeCycleStatus status = lifeCycleEvent.getStatus();
               if (LifeCycleStatus.STARTED.equals(status))
               {
                  final PortletInfo info = portletContainer.getInfo();
                  // only add the portlet if it's remotable
                  if (isRemotable(info.getRuntimeOptionsInfo()))
                  {
                     serviceDescription.addPortletDescription(pc, info);
                  }
               }
               else
View Full Code Here

               {
                  try
                  {
                     // retrieve initial context from portlet info and get description from it
                     Portlet portlet = producer.getPortletWith(pcContext, registration);
                     PortletInfo info = portlet.getInfo();
                     org.gatein.pc.api.PortletContext original = org.gatein.pc.api.PortletContext.createPortletContext(info.getApplicationName(), info.getName());
                     return getPortletDescription(original.getId(), desiredLocales);
                  }
                  catch (Exception e)
                  {
                     log.debug("Couldn't retrieve portlet " + pcContext, e);
View Full Code Here

         UserContext userContext = getPortletPropertyDescription.getUserContext();
         checkUserAuthorization(userContext);

         Portlet portlet = getPortletFrom(portletContext, registration);
         PortletInfo info = portlet.getInfo();
         PreferencesInfo prefsInfo = info.getPreferences();

         List<PropertyDescription> descs = Collections.emptyList();
         if (prefsInfo != null)
         {
            Set keySet = prefsInfo.getKeys();
View Full Code Here

            properties = producer.getPortletInvoker().getProperties(jbpContext);
         }

         //todo: we need to check that the user can actually modify the properties
         Portlet portlet = getPortletFrom(portletContext, registration);
         PortletInfo info = portlet.getInfo();

         PropertyList result = WSRPTypeFactory.createPropertyList();
         int propertyNb = properties.size();

         if (propertyNb > 0)
         {
            PreferenceInfo prefInfo;
            String key;
            List<String> values;
            LocalizedString displayName;

            for (Map.Entry<String, List<String>> entry : properties.entrySet())
            {
               key = entry.getKey();
               values = entry.getValue();
               prefInfo = info.getPreferences().getPreference(key);
               displayName = prefInfo.getDisplayName();
               String lang = WSRPUtils.toString(displayName.getDefaultLocale());

               // todo: support multi-valued properties
               if (values.size() != 1)
View Full Code Here

            QName eventName = eventInvocation.getName();
            String containerId = container.getId();
            String applicationId = application.getId();

            //
            PortletInfo info = container.getInfo();
            EventingInfo eventingInfo = info.getEventing();
            Map<QName, ? extends EventInfo> consumedEventInfos = eventingInfo.getConsumedEvents();
            EventInfo eventInfo = consumedEventInfos.get(eventName);

            //
            if (trace)
View Full Code Here

TOP

Related Classes of org.gatein.pc.api.info.PortletInfo

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.