Package org.gatein.pc.api.info

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


   public MimeResponseImpl(PortletInvocation invocation, PortletRequestImpl preq)
   {
      super(invocation, preq);

      // Configure expiration value
      PortletInfo info = preq.container.getInfo();

      // 0 means no buffering - we say no buffering
      this.bufferSize = 0;
      this.contentTypeSet = false;
      this.canSetContentType = true;
View Full Code Here


            cacheControl.isPublicScope() ? CacheScope.PUBLIC : CacheScope.PRIVATE,
            cacheControl.getETag());
      }
      else
      {
         PortletInfo info = preq.container.getInfo();
         CacheInfo cacheInfo = info.getCache();
         cc = new org.gatein.pc.api.cache.CacheControl(cacheInfo.getExpirationSecs(), CacheScope.PRIVATE, null);
      }

      //
      if (cacheControl != null && cacheControl.useCachedContent())
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

{

   public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
   {
      PortletContainer container = (PortletContainer)invocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);
      PortletInfo containerInfo = container.getInfo();
      SecurityInfo securityInfo = containerInfo.getSecurity();
      SecurityContext securityContext = invocation.getSecurityContext();
      boolean invoke = true;
      if (!securityContext.isSecure())
      {
         if (securityInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL))
View Full Code Here

        PortletInvoker portletInvoker = (PortletInvoker) manager.getComponentInstance(PortletInvoker.class);
        Set<org.gatein.pc.api.Portlet> portlets = portletInvoker.getPortlets();

        //
        portlet: for (org.gatein.pc.api.Portlet portlet : portlets) {
            PortletInfo info = portlet.getInfo();
            String portletApplicationName = info.getApplicationName();
            String portletName = portlet.getContext().getId();

            // Need to sanitize portlet and application names in case they contain characters that would
            // cause an improper Application name
            portletApplicationName = portletApplicationName.replace('/', '_');
            portletName = portletName.replace('/', '_');

            MetaInfo metaInfo = portlet.getInfo().getMeta();
            LocalizedString keywordsLS = metaInfo.getMetaValue(MetaInfo.KEYWORDS);

            //
            Set<String> categoryNames = new HashSet<String>();

            // Process keywords
            if (keywordsLS != null) {
                String keywords = keywordsLS.getDefaultString();
                if (keywords != null && keywords.length() != 0) {
                    for (String categoryName : keywords.split(",")) {
                        // Trim name
                        categoryName = categoryName.trim();
                        if (INTERNAL_PORTLET_TAG.equalsIgnoreCase(categoryName)) {
                            log.debug("Skipping portlet (" + portletApplicationName + "," + portletName
                                    + ") + tagged as internal");
                            continue portlet;
                        } else {
                            categoryNames.add(categoryName);
                        }
                    }
                }
            }

            ArrayList<String> permissions = new ArrayList<String>();
            permissions.add(UserACL.EVERYONE);
            // If no keywords, use the portlet application name
            if (categoryNames.isEmpty()) {
                categoryNames.add(portletApplicationName.trim());
            }

            // Additionally categorise the portlet as remote
            boolean remote = portlet.isRemote();
            if (remote) {
                categoryNames.add(REMOTE_CATEGORY_NAME);

                // add producer name to categories for easier finding of portlets for GTNPORTAL-823
                LocalizedString producerNameLS = metaInfo.getMetaValue(PRODUCER_NAME_META_INFO_KEY);
                if (producerNameLS != null) {
                    categoryNames.add(producerNameLS.getDefaultString() + PRODUCER_CATEGORY_NAME_SUFFIX);
                }
            }

            //
            log.info("Importing portlet (" + portletApplicationName + "," + portletName + ") in categories " + categoryNames);

            // Process category names
            for (String categoryName : categoryNames) {
                CategoryDefinition category = registry.getCategory(categoryName);

                //
                if (category == null) {
                    category = registry.createCategory(categoryName);
                    category.setDisplayName(categoryName);
                    category.setAccessPermissions(permissions);
                }

                //
                ContentDefinition app = category.getContentMap().get(portletName);
                if (app == null) {
                    LocalizedString descriptionLS = metaInfo.getMetaValue(MetaInfo.DESCRIPTION);
                    LocalizedString displayNameLS = metaInfo.getMetaValue(MetaInfo.DISPLAY_NAME);
                    String displayName = getLocalizedStringValue(displayNameLS, portletName);

                    ContentType<?> contentType;
                    String contentId;
                    if (remote) {
                        contentType = WSRP.CONTENT_TYPE;
                        contentId = portlet.getContext().getId();
                        displayName += REMOTE_DISPLAY_NAME_SUFFIX; // add remote to display name to make it more obvious that
                                                                   // the portlet is remote
                    } else {
                        contentType = Portlet.CONTENT_TYPE;
                        contentId = info.getApplicationName() + "/" + info.getName();
                    }

                    // Check if the portlet has already existed in this category
                    List<Application> applications = load(category).getApplications();
                    boolean isExist = false;
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

   }

   boolean push(WindowEvent consumedEvent, WindowEvent producedEvent)
   {
      String producerId = producedEvent.getWindowId();
      PortletInfo producerPortletInfo = context.getPortletInfo(producerId);

      //
      if (producerPortletInfo == null)
      {
         log.trace("Cannot deliver event " + producedEvent +" because the producer does not have portlet info");
         safeInvoker.eventDiscarded(context.getEventControllerContext(), this, producedEvent, EventControllerContext.EVENT_PRODUCER_INFO_NOT_AVAILABLE);
         return true;
      }
      else
      {
         //
         if (!controller.getDistributeNonProduceableEvents())
         {
            if (!producerPortletInfo.getEventing().getProducedEvents().containsKey(producedEvent.getName()))
            {
               log.trace("Cannot deliver event " + producedEvent +" because the producer of the event does not produce the event name");
               safeInvoker.eventDiscarded(context.getEventControllerContext(), this, producedEvent, EventControllerContext.PORTLET_DOES_NOT_CONSUME_EVENT);
               return true;
            }
View Full Code Here

      {
         WindowEvent toConsumeEvent = toConsumeEvents.removeFirst();
         String consumedId = toConsumeEvent.getWindowId();

         //
         PortletInfo consumerPortletInfo = context.getPortletInfo(consumedId);
         if (consumerPortletInfo == null)
         {
            log.trace("Cannot deliver event " + toConsumeEvent +" because the consumer of the event does not have a portlet info");
            safeInvoker.eventDiscarded(context.getEventControllerContext(), this, toConsumeEvent, EventControllerContext.EVENT_CONSUMER_INFO_NOT_AVAILABLE);
            continue;
         }

         //
         if (!controller.getDistributeNonConsumableEvents())
         {
            if (!consumerPortletInfo.getEventing().getConsumedEvents().containsKey(toConsumeEvent.getName()))
            {
               log.trace("Cannot deliver event " + toConsumeEvent +" because the consumer of the event does not accept the event name");
               safeInvoker.eventDiscarded(context.getEventControllerContext(), this, toConsumeEvent, EventControllerContext.PORTLET_DOES_NOT_CONSUME_EVENT);
               continue;
            }
View Full Code Here

      ControllerContext controller,
      PageNavigationalState page,
      String portletWindowId,
      Map<String, String[]> update)
   {
      PortletInfo info = controller.getPortletInfo(portletWindowId);
      if (info != null)
      {
         NavigationInfo navigationInfo = info.getNavigation();
         for (Map.Entry<String, String[]> entry : update.entrySet())
         {
            String id = entry.getKey();
            ParameterInfo parameterInfo = navigationInfo.getPublicParameter(id);
            if (parameterInfo != null)
View Full Code Here

      }
   }

   public Map<String, String[]> getPublicWindowNavigationalState(ControllerContext controller, PageNavigationalState page, String windowId)
   {
      PortletInfo info = controller.getPortletInfo(windowId);

      //
      if (info != null)
      {
         ParameterMap publicNavigationalState = new ParameterMap();
         for (ParameterInfo parameterInfo : info.getNavigation().getPublicParameters())
         {
            String[] parameterValue = page.getPublicNavigationalState(parameterInfo.getName());

            //
            if (parameterValue != 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.