Package org.gatein.pc.api.info

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


        if (portlets == null || portlets.isEmpty()) {
            return;
        }

        for (Portlet portlet : portlets) {
            PortletInfo info = portlet.getInfo();

            // in the remote case, the "application name" will be the name of the remote invoker
            String appName;
            if (remote) {
                LocalizedString producerNameLS = info.getMeta().getMetaValue(PRODUCER_NAME_META_INFO_KEY);
                if (producerNameLS != null) {
                    appName = producerNameLS.getDefaultString();
                } else {
                    throw new IllegalStateException("Missing PortletInvoker id in remote portlet metadata");
                }
            } else {
                appName = info.getApplicationName();
            }

            WebApp webApp = getWebApp(appName);
            if (webApp == null) {
                webApp = new WebApp(appName);
View Full Code Here


        private PortletInfo portletInfo_;

        final PortletContext context;

        public PortletExtra(Portlet portlet) {
            PortletInfo info = portlet.getInfo();

            context = portlet.getContext();

            String appName = info.getApplicationName();
            boolean remote = portlet.isRemote();

            String portletId;
            if (remote) {
                portletId = context.getId();
            } else {
                portletId = info.getApplicationName() + "/" + info.getName();
            }

            String type = remote ? REMOTE : LOCAL;

            //
            id_ = portletId;
            group_ = appName;
            name_ = info.getName();
            type_ = type;
            portletInfo_ = info;

        }
View Full Code Here

        FederatingPortletInvoker portletInvoker = (FederatingPortletInvoker) manager
                .getComponentInstance(FederatingPortletInvoker.class);
        Set<Portlet> portlets = remote ? portletInvoker.getRemotePortlets() : portletInvoker.getLocalPortlets();
        List<Application> applications = new ArrayList<Application>(portlets.size());
        for (Portlet portlet : portlets) {
            PortletInfo info = portlet.getInfo();

            LocalizedString descriptionLS = info.getMeta().getMetaValue(MetaInfo.DESCRIPTION);
            LocalizedString displayNameLS = info.getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);

            String portletName = info.getName();
            Application app = new Application();
            app.setApplicationName(portletName);
            // app.setApplicationGroup(info.getApplicationName());
            ApplicationType appType;
            String contentId;
            String displayName = Util.getLocalizedStringValue(displayNameLS, portletName);
            if (remote) {
                appType = ApplicationType.WSRP_PORTLET;
                contentId = portlet.getContext().getId();
                displayName += ApplicationRegistryService.REMOTE_DISPLAY_NAME_SUFFIX; // add remote to display name to make it
                                                                                      // more obvious that the portlet is remote
            } else {
                appType = ApplicationType.PORTLET;
                contentId = info.getApplicationName() + "/" + info.getName();
            }
            app.setType(appType);
            app.setDisplayName(displayName);
            app.setDescription(Util.getLocalizedStringValue(descriptionLS, portletName));
            app.setAccessPermissions(new ArrayList<String>());
View Full Code Here

      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

         return;
      }

      for (Portlet portlet : portlets)
      {
         PortletInfo info = portlet.getInfo();
         String appName = info.getApplicationName();

         WebApp webApp = getWebApp(appName);
         if (webApp == null)
         {
            webApp = new WebApp(appName);
View Full Code Here

      private static final String SEPARATOR = "/";
      private static final int SEPARATOR_LENGTH = SEPARATOR.length();

      public PortletExtra(Portlet portlet)
      {
         PortletInfo info = portlet.getInfo();
         String portletName = info.getName();
         String appName = info.getApplicationName();
         boolean remote = portlet.isRemote();

         // if the portlet is remote, we might have an extra '/' at the beginning of the portlet name
         if(remote && portletName.startsWith(SEPARATOR))
         {
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

        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())) {
                supportModes.add(modeName);
View Full Code Here

            QName eventName = eventInvocation.getName();

            boolean trace = log.isTraceEnabled();

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

            Class dstPayloadClass;
            if (eventInfo != null)
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.