Package org.gatein.pc.portlet.impl.metadata

Examples of org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData


   private void fixMetaData(PortletApplication10MetaData portletApplicationMD)
   {
      if (portletApplicationMD instanceof PortletApplication20MetaData)
      {
         PortletApplication20MetaData tmp = (PortletApplication20MetaData)portletApplicationMD;
         if (tmp.getEvents() == null)
         {
            tmp.setEvents(EMPTY_EVENT_DEFINITION_LIST);
         }
         if (tmp.getPublicRenderParameters() == null)
         {
            tmp.setPublicRenderParameters(EMPTY_PUBLIC_RENDER_PARAMETER_LIST);
         }
         if (tmp.getDefaultNamespace() == null)
         {
            try
            {
               tmp.setDefaultNamespace(new URI(XMLConstants.NULL_NS_URI));
            }
            catch (URISyntaxException e)
            {
               throw new Error(e);
            }
         }
         if (tmp.getListeners() == null)
         {
            tmp.setListeners(EMPTY_LISTENER_LIST);
         }
         if (tmp.getFilters() == null)
         {
            tmp.setFilters(EMPTY_FILTER_MAP);
         }
         for (FilterMetaData filterMD : tmp.getFilters().values())
         {
            if (filterMD.getInitParams() == null)
            {
               filterMD.setInitParams(EMPTY_INIT_PARAM_LIST);
            }
         }
         if (tmp.getFilterMapping() == null)
         {
            tmp.setFilterMapping(EMPTY_FILTER_MAPPING_LIST);
         }
         if (tmp.getContainerRuntimeOptions() == null)
         {
            tmp.setContainerRuntimeOptions(EMPTY_CONTAINER_RUNTIME_OPTION_MAP);
         }
      }

      //
      if (portletApplicationMD.getCustomPortletModes() == null)
View Full Code Here


      String defaultNamespace = XMLConstants.NULL_NS_URI;
      List<ContainerListenerInfo> listeners = Collections.emptyList();
      Map<String, ContainerFilterInfo> allFilters = new HashMap<String, ContainerFilterInfo>();
      if (this.portletApplicationMD instanceof PortletApplication20MetaData)
      {
         PortletApplication20MetaData tmp = (PortletApplication20MetaData)this.portletApplicationMD;

         //
         defaultNamespace = tmp.getDefaultNamespace() != null ? tmp.getDefaultNamespace().toString() : null;

         //
         for (EventDefinitionMetaData eventDefinitionMD : tmp.getEvents())
         {
            try
            {
               ContainerEventInfo event = build(eventDefinitionMD);
               events.put(event.getName(), event);
            }
            catch (NoSuchClassException e)
            {
               log.error("Cannot load event class " + e.getClassName(), e);
            }
         }

         //
         for (PublicRenderParameterMetaData parameterMD : tmp.getPublicRenderParameters())
         {
            ContainerParameterInfo parameter = build(parameterMD);

            //
            publicParameters.put(parameter.getId(), parameter);
         }

         //
         Map<String, RuntimeOptionInfo> applicationOptions = build(tmp.getContainerRuntimeOptions().values());
         if (applicationOptions != null)
         {
            this.applicationOptions.putAll(applicationOptions);
         }

         //
         listeners = new ArrayList<ContainerListenerInfo>(tmp.getListeners().size());
         for (ListenerMetaData listenerMD : tmp.getListeners())
         {
            ContainerListenerInfo listener = build(listenerMD);
            listeners.add(listener);
         }
         listeners = Collections.unmodifiableList(listeners);

         //
         for (FilterMetaData filterMD : tmp.getFilterCollection())
         {
            ContainerFilterInfo filter = build(filterMD);
            allFilters.put(filter.getName(), filter);
         }
      }
View Full Code Here

      }

      // portlet-app 2.0
      if (parent instanceof PortletApplication20MetaData)
      {
         PortletApplication20MetaData md = (PortletApplication20MetaData)parent;
         // add public-render-parameter
         if (child instanceof PublicRenderParameterMetaData)
         {
            md.addPublicRenderParameter((PublicRenderParameterMetaData)child);
         }
         // add event-defintion
         else if (child instanceof EventDefinitionMetaData)
         {
            md.addEventDefinition((EventDefinitionMetaData)child);
         }
         // add filter
         else if (child instanceof FilterMetaData)
         {
            FilterMetaData filter = (FilterMetaData)child;
            filter.setDisplayName(this.displayNames.getLocalizedString(filter));
            md.addFilter(filter);
         }
         // add filter-mapping
         else if (child instanceof FilterMappingMetaData)
         {
            md.addFilterMapping((FilterMappingMetaData)child);
         }
         // add container-runtime-option
         else if (child instanceof ContainerRuntimeMetaData)
         {
            md.addContainerRuntime((ContainerRuntimeMetaData)child);
         }
         // add listener
         else if (child instanceof ListenerMetaData)
         {
            ListenerMetaData listener = (ListenerMetaData)child;
            listener.setDisplayName(this.displayNames.getLocalizedString(listener));
            md.addListener(listener);
         }
      }

      // portlet
      if (parent instanceof PortletMetaData)
      {
         PortletMetaData md = (PortletMetaData)parent;
         // init-param
         if (child instanceof InitParamMetaData)
         {
            md.addInitParam((InitParamMetaData)child);
         }
         // supports
         else if (child instanceof SupportsMetaData)
         {
            md.addSupport((SupportsMetaData)child);
         }
         // supported-locale
         else if (child instanceof SupportedLocaleMetaData)
         {
            md.addSupportedLocale((SupportedLocaleMetaData)child);
         }
         // portlet-info
         else if (child instanceof PortletInfoMetaData)
         {
            md.setPortletInfo((PortletInfoMetaData)child);
         }
         // portlet-preferences
         else if (child instanceof PortletPreferencesMetaData)
         {
            md.setPortletPreferences((PortletPreferencesMetaData)child);
         }
         // security-role-ref
         else if (child instanceof SecurityRoleRefMetaData)
         {
            md.addSecurityRoleRef((SecurityRoleRefMetaData)child);
         }
         // supported-events
         else if (child instanceof EventDefinitionReferenceMetaData)
         {
            if ("supported-processing-event".equals(localName))
            {
               md.addSupportedProcessingEvent((EventDefinitionReferenceMetaData)child);
            }
            else if ("supported-publishing-event".equals(localName))
            {
               md.addSupportedPublishingEvent((EventDefinitionReferenceMetaData)child);
            }
         }
         // container-runtime-option
         else if (child instanceof ContainerRuntimeMetaData)
         {
            md.addContainerRuntime((ContainerRuntimeMetaData)child);
         }
      }

      // adding user-data-constraint and portlet-name(s) to security-constraint
      if (parent instanceof SecurityConstraintMetaData)
      {
         SecurityConstraintMetaData md = (SecurityConstraintMetaData)parent;
         // add user-data-constraint
         if (child instanceof UserDataConstraintMetaData)
         {
            md.setUserDataConstraint((UserDataConstraintMetaData)child);
         }
         // add portlet-collection
         else if (child instanceof PortletCollectionMetaData)
         {
            md.setPortletList((PortletCollectionMetaData)child);
         }
      }

      // filter
      if (parent instanceof FilterMetaData)
      {
         FilterMetaData md = (FilterMetaData)parent;
         // add init-param
         if (child instanceof InitParamMetaData)
         {
            md.addInitParam((InitParamMetaData)child);
         }
      }

      // add portlet-mode and window-state
      if (parent instanceof SupportsMetaData)
      {
         SupportsMetaData md = (SupportsMetaData)parent;
         if (child instanceof PortletModeMetaData)
         {
            md.addPortletMode((PortletModeMetaData)child);
         }
         else if (child instanceof WindowStateMetaData)
         {
            md.addWindowState((WindowStateMetaData)child);
         }
      }

      // add preference
      if (parent instanceof PortletPreferencesMetaData)
      {
         PortletPreferencesMetaData md = (PortletPreferencesMetaData)parent;
         if (child instanceof PortletPreferenceMetaData)
         {
            md.addPortletPreference((PortletPreferenceMetaData)child);
         }
      }
   }
View Full Code Here

   {

      // JSR 286 portlet-app attributes - default-namespace and resource-bundle.
      if (object instanceof PortletApplication20MetaData)
      {
         PortletApplication20MetaData md = (PortletApplication20MetaData)object;
         if ("resource-bundle".equals(localName))
         {
            md.setResourceBundle(value);
         }
         else if ("default-namespace".equals(localName))
         {
            try
            {
               md.setDefaultNamespace(new URI(value));
            }
            catch (URISyntaxException e)
            {
               log.error("Invalid syntax for default-namespace: " + value);
            }
         }
      }

      // portlet
      if (object instanceof PortletMetaData)
      {
         PortletMetaData md = (PortletMetaData)object;
         if ("portlet-name".equals(localName))
         {
            md.setPortletName(value);
         }
         else if ("portlet-class".equals(localName))
         {
            md.setPortletClass(value);
         }
         else if ("cache-scope".equals(localName) && PORTLET_JSR_286_NS.equals(nsURI))
         {
            md.setCacheScope(PortletCacheScopeEnum.valueOf(value));
         }
         else if ("expiration-cache".equals(localName))
         {
            md.setExpirationCache(Integer.valueOf(value));
         }
         else if ("resource-bundle".equals(localName))
         {
            md.setResourceBundle(value);
         }
         else if ("supported-public-render-parameter".equals(localName) && PORTLET_JSR_286_NS.equals(nsURI))
         {
            md.addSupportedPublicRenderParameter(value);
         }
      }

      if (object instanceof LocalizedDescriptionMetaData)
      {
         LocalizedDescriptionMetaData localized = (LocalizedDescriptionMetaData)object;
         if ("description".equals(localName))
         {
            localized.setDescription(value);
         }
         else if ("display-name".equals(localName))
         {
            localized.setDescription(value);
         }
      }

      // init-param
      if (object instanceof InitParamMetaData)
      {
         InitParamMetaData md = (InitParamMetaData)object;
         if ("name".equals(localName))
         {
            md.setName(value);
         }
         else if ("value".equals(localName))
         {
            md.setValue(value);
         }
      }

      // supports
      if (object instanceof SupportsMetaData)
      {
         SupportsMetaData md = (SupportsMetaData)object;
         if ("mime-type".equals(localName))
         {
            md.setMimeType(value);
         }
      }

      // supports --- portlet-mode
      if (object instanceof PortletModeMetaData)
      {
         PortletModeMetaData md = (PortletModeMetaData)object;
         if ("portlet-mode".equals(localName))
         {
            md.setPortletMode(org.gatein.pc.api.Mode.create(value));
         }
      }

      // supports --- window-state
      if (object instanceof WindowStateMetaData)
      {
         WindowStateMetaData md = (WindowStateMetaData)object;
         if ("window-state".equals(localName))
         {
            md.setWindowState(org.gatein.pc.api.WindowState.create(value));
         }
      }

      // supported-locale
      if (object instanceof SupportedLocaleMetaData)
      {
         SupportedLocaleMetaData md = (SupportedLocaleMetaData)object;
         if ("supported-locale".equals(localName))
         {
            md.setLocale(value);
         }
      }

      // portlet-info
      if (object instanceof PortletInfoMetaData)
      {
         PortletInfoMetaData md = (PortletInfoMetaData)object;
         if ("title".equals(localName))
         {
            md.setTitle(value);
         }
         else if ("short-title".equals(localName))
         {
            md.setShortTitle(value);
         }
         else if ("keywords".equals(localName))
         {
            md.setKeywords(value);
         }
      }

      // portlet-preferences
      if (object instanceof PortletPreferencesMetaData)
      {
         PortletPreferencesMetaData md = (PortletPreferencesMetaData)object;
         if ("preferences-validator".equals(localName))
         {
            md.setPreferenceValidator(value);
         }
      }

      // preference
      if (object instanceof PortletPreferenceMetaData)
      {
         PortletPreferenceMetaData md = (PortletPreferenceMetaData)object;
         if ("name".equals(localName))
         {
            md.setName(value);
         }
         else if ("value".equals(localName))
         {
            md.addValue(value);
         }
         else if ("read-only".equals(localName))
         {
            md.setReadOnly(Boolean.valueOf(value));
         }
      }

      // security-role-ref
      if (object instanceof SecurityRoleRefMetaData)
      {
         SecurityRoleRefMetaData md = (SecurityRoleRefMetaData)object;
         if ("role-name".equals(localName))
         {
            md.setRoleName(value);
         }
         else if ("role-link".equals(localName))
         {
            md.setRoleLink(value);
         }
      }

      // supported events
      if (object instanceof EventDefinitionReferenceMetaData)
      {
         EventDefinitionReferenceMetaData md = (EventDefinitionReferenceMetaData)object;
         if ("qname".equals(localName))
         {
            md.setQname(nav.resolveQName(value));
         }
         else if ("name".equals(localName))
         {
            md.setName(value);
         }
      }

      // custom-portlet-mode
      if (object instanceof CustomPortletModeMetaData)
      {
         CustomPortletModeMetaData mode = (CustomPortletModeMetaData)object;
         if ("portlet-mode".equals(localName))
         {
            mode.setPortletMode(value);
         }
         else if ("portal-managed".equals(localName) && PORTLET_JSR_286_NS.equals(nsURI))
         {
            mode.setPortalManaged(Boolean.parseBoolean(value));
         }
      }

      // custom-window-state
      if (object instanceof CustomWindowStateMetaData)
      {
         CustomWindowStateMetaData md = (CustomWindowStateMetaData)object;
         if ("window-state".equals(localName))
         {
            md.setWindowState(value);
         }
      }

      // user-attribute
      if (object instanceof UserAttributeMetaData)
      {
         UserAttributeMetaData md = (UserAttributeMetaData)object;
         if ("name".equals(localName))
         {
            md.setName(value);
         }
      }

      // user-data-constraint
      if (object instanceof UserDataConstraintMetaData)
      {
         UserDataConstraintMetaData md = (UserDataConstraintMetaData)object;
         if ("transport-guarantee".equals(localName))
         {
            md.setTransportGuarantee(TransportGuarantee.valueOf(value));
         }
      }

      // portlet-collection in security-constraint
      if (object instanceof PortletCollectionMetaData)
      {
         PortletCollectionMetaData md = (PortletCollectionMetaData)object;
         if ("portlet-name".equals(localName))
         {
            md.addPortletname(value);
         }
      }

      // filter
      if (object instanceof FilterMetaData && PORTLET_JSR_286_NS.equals(nsURI))
      {
         FilterMetaData md = (FilterMetaData)object;
         if ("filter-class".equals(localName))
         {
            md.setFilterClass(value);
         }
         else if ("filter-name".equals(localName))
         {
            md.setFilterName(value);
         }
         else if ("lifecycle".equals(localName))
         {
            int end = value.length() - "_PHASE".length();
            String lifeCycle = value.substring(0, end > 0 ? end : 0);
            try
            {
               md.addLifecycle(LifeCyclePhase.valueOf(lifeCycle));
            }
            catch (IllegalArgumentException e)
            {
               throw new IllegalArgumentException("Invalid value for lifecycle. Valid values are [RENDER_PHASE, RESOURCE_PHASE, ACTION_PHASE, EVENT_PHASE]");
            }
         }
      }

      // filter-mapping
      if (object instanceof FilterMappingMetaData && PORTLET_JSR_286_NS.equals(nsURI))
      {
         FilterMappingMetaData md = (FilterMappingMetaData)object;
         if ("filter-name".equals(localName))
         {
            md.setName(value);
         }
         if ("portlet-name".equals(localName))
         {
            md.addPortletName(value);
         }
      }

      // event-defintion
      if (object instanceof EventDefinitionMetaData && PORTLET_JSR_286_NS.equals(nsURI))
      {
         EventDefinitionMetaData md = (EventDefinitionMetaData)object;
         if ("name".equals(localName))
         {
            md.setName(value);
         }
         else if ("qname".equals(localName))
         {
            md.setQname(nav.resolveQName(value));
         }
         else if ("value-type".equals(localName))
         {
            md.setValueType(value);
         }
         else if ("alias".equals(localName))
         {
            md.addAlias(nav.resolveQName(value));
         }
      }

      // public-render-parameter
      if (object instanceof PublicRenderParameterMetaData && PORTLET_JSR_286_NS.equals(nsURI))
      {
         PublicRenderParameterMetaData md = (PublicRenderParameterMetaData)object;
         if ("identifier".equals(localName))
         {
            md.setIdentifier(value);
         }
         else if ("name".equals(localName))
         {
            md.setName(value);
         }
         else if ("qname".equals(localName))
         {
            md.setQname(nav.resolveQName(value));
         }
         else if ("alias".equals(localName))
         {
            md.addAlias(nav.resolveQName(value));
         }
      }

      // container-runtime-option
      if (object instanceof ContainerRuntimeMetaData && PORTLET_JSR_286_NS.equals(nsURI))
      {
         ContainerRuntimeMetaData md = (ContainerRuntimeMetaData)object;
         if ("name".equals(localName))
         {
            md.setName(value);
         }
         else if ("value".equals(localName))
         {
            md.addValue(value);
         }
      }

      // listener
      if (object instanceof ListenerMetaData && PORTLET_JSR_286_NS.equals(nsURI))
      {
         ListenerMetaData md = (ListenerMetaData)object;
         if ("listener-class".equals(localName))
         {
            md.setListenerClass(value);
         }
      }
   }
View Full Code Here

   private void fixMetaData(PortletApplication10MetaData portletApplicationMD)
   {
      if (portletApplicationMD instanceof PortletApplication20MetaData)
      {
         PortletApplication20MetaData tmp = (PortletApplication20MetaData)portletApplicationMD;
         if (tmp.getEvents() == null)
         {
            tmp.setEvents(EMPTY_EVENT_DEFINITION_LIST);
         }
         if (tmp.getPublicRenderParameters() == null)
         {
            tmp.setPublicRenderParameters(EMPTY_PUBLIC_RENDER_PARAMETER_LIST);
         }
         if (tmp.getDefaultNamespace() == null)
         {
            try
            {
               tmp.setDefaultNamespace(new URI(XMLConstants.NULL_NS_URI));
            }
            catch (URISyntaxException e)
            {
               throw new Error(e);
            }
         }
         if (tmp.getListeners() == null)
         {
            tmp.setListeners(EMPTY_LISTENER_LIST);
         }
         if (tmp.getFilters() == null)
         {
            tmp.setFilters(EMPTY_FILTER_MAP);
         }
         for (FilterMetaData filterMD : tmp.getFilters().values())
         {
            if (filterMD.getInitParams() == null)
            {
               filterMD.setInitParams(EMPTY_INIT_PARAM_LIST);
            }
         }
         if (tmp.getFilterMapping() == null)
         {
            tmp.setFilterMapping(EMPTY_FILTER_MAPPING_LIST);
         }
         if (tmp.getContainerRuntimeOptions() == null)
         {
            tmp.setContainerRuntimeOptions(EMPTY_CONTAINER_RUNTIME_OPTION_MAP);
         }
      }

      //
      if (portletApplicationMD.getCustomPortletModes() == null)
View Full Code Here

      String defaultNamespace = XMLConstants.NULL_NS_URI;
      List<ContainerListenerInfo> listeners = Collections.emptyList();
      Map<String, ContainerFilterInfo> allFilters = new HashMap<String, ContainerFilterInfo>();
      if (this.portletApplicationMD instanceof PortletApplication20MetaData)
      {
         PortletApplication20MetaData tmp = (PortletApplication20MetaData)this.portletApplicationMD;

         //
         defaultNamespace = tmp.getDefaultNamespace() != null ? tmp.getDefaultNamespace().toString() : null;

         //
         for (EventDefinitionMetaData eventDefinitionMD : tmp.getEvents())
         {
            try
            {
               ContainerEventInfo event = build(eventDefinitionMD);
               events.put(event.getName(), event);
            }
            catch (NoSuchClassException e)
            {
               log.error("Cannot load event class " + e.getClassName(), e);
            }
         }

         //
         for (PublicRenderParameterMetaData parameterMD : tmp.getPublicRenderParameters())
         {
            ContainerParameterInfo parameter = build(parameterMD);

            //
            publicParameters.put(parameter.getId(), parameter);
         }

         //
         Map<String, RuntimeOptionInfo> applicationOptions = build(tmp.getContainerRuntimeOptions().values());
         if (applicationOptions != null)
         {
            this.applicationOptions.putAll(applicationOptions);
         }

         //
         listeners = new ArrayList<ContainerListenerInfo>(tmp.getListeners().size());
         for (ListenerMetaData listenerMD : tmp.getListeners())
         {
            ContainerListenerInfo listener = build(listenerMD);
            listeners.add(listener);
         }
         listeners = Collections.unmodifiableList(listeners);

         //
         for (FilterMetaData filterMD : tmp.getFilterCollection())
         {
            ContainerFilterInfo filter = build(filterMD);
            allFilters.put(filter.getName(), filter);
         }
      }
View Full Code Here

   private void fixMetaData(PortletApplication10MetaData portletApplicationMD)
   {
      if (portletApplicationMD instanceof PortletApplication20MetaData)
      {
         PortletApplication20MetaData tmp = (PortletApplication20MetaData)portletApplicationMD;
         if (tmp.getEvents() == null)
         {
            tmp.setEvents(EMPTY_EVENT_DEFINITION_LIST);
         }
         if (tmp.getPublicRenderParameters() == null)
         {
            tmp.setPublicRenderParameters(EMPTY_PUBLIC_RENDER_PARAMETER_LIST);
         }
         if (tmp.getDefaultNamespace() == null)
         {
            try
            {
               tmp.setDefaultNamespace(new URI(XMLConstants.NULL_NS_URI));
            }
            catch (URISyntaxException e)
            {
               throw new Error(e);
            }
         }
         if (tmp.getListeners() == null)
         {
            tmp.setListeners(EMPTY_LISTENER_LIST);
         }
         if (tmp.getFilters() == null)
         {
            tmp.setFilters(EMPTY_FILTER_MAP);
         }
         for (FilterMetaData filterMD : tmp.getFilters().values())
         {
            if (filterMD.getInitParams() == null)
            {
               filterMD.setInitParams(EMPTY_INIT_PARAM_LIST);
            }
         }
         if (tmp.getFilterMapping() == null)
         {
            tmp.setFilterMapping(EMPTY_FILTER_MAPPING_LIST);
         }
         if (tmp.getContainerRuntimeOptions() == null)
         {
            tmp.setContainerRuntimeOptions(EMPTY_CONTAINER_RUNTIME_OPTION_MAP);
         }
      }

      //
      if (portletApplicationMD.getCustomPortletModes() == null)
View Full Code Here

      String defaultNamespace = XMLConstants.NULL_NS_URI;
      List<ContainerListenerInfo> listeners = Collections.emptyList();
      Map<String, ContainerFilterInfo> allFilters = new HashMap<String, ContainerFilterInfo>();
      if (this.portletApplicationMD instanceof PortletApplication20MetaData)
      {
         PortletApplication20MetaData tmp = (PortletApplication20MetaData)this.portletApplicationMD;

         //
         defaultNamespace = tmp.getDefaultNamespace() != null ? tmp.getDefaultNamespace().toString() : null;

         //
         for (EventDefinitionMetaData eventDefinitionMD : tmp.getEvents())
         {
            try
            {
               ContainerEventInfo event = build(eventDefinitionMD);
               events.put(event.getName(), event);
            }
            catch (NoSuchClassException e)
            {
//               log.error("Cannot load event class " + e.getClassName(), e);
            }
         }

         //
         for (PublicRenderParameterMetaData parameterMD : tmp.getPublicRenderParameters())
         {
            ContainerParameterInfo parameter = build(parameterMD);

            //
            publicParameters.put(parameter.getId(), parameter);
         }

         //
         Map<String, RuntimeOptionInfo> applicationOptions = build(tmp.getContainerRuntimeOptions().values());
         if (applicationOptions != null)
         {
            this.applicationOptions.putAll(applicationOptions);
         }

         //
         listeners = new ArrayList<ContainerListenerInfo>(tmp.getListeners().size());
         for (ListenerMetaData listenerMD : tmp.getListeners())
         {
            ContainerListenerInfo listener = build(listenerMD);
            listeners.add(listener);
         }
         listeners = Collections.unmodifiableList(listeners);

         //
         for (FilterMetaData filterMD : tmp.getFilterCollection())
         {
            ContainerFilterInfo filter = build(filterMD);
            allFilters.put(filter.getName(), filter);
         }
      }
View Full Code Here

   private void fixMetaData(PortletApplication10MetaData portletApplicationMD)
   {
      if (portletApplicationMD instanceof PortletApplication20MetaData)
      {
         PortletApplication20MetaData tmp = (PortletApplication20MetaData)portletApplicationMD;
         if (tmp.getEvents() == null)
         {
            tmp.setEvents(EMPTY_EVENT_DEFINITION_LIST);
         }
         if (tmp.getPublicRenderParameters() == null)
         {
            tmp.setPublicRenderParameters(EMPTY_PUBLIC_RENDER_PARAMETER_LIST);
         }
         if (tmp.getDefaultNamespace() == null)
         {
            try
            {
               tmp.setDefaultNamespace(new URI(XMLConstants.NULL_NS_URI));
            }
            catch (URISyntaxException e)
            {
               throw new Error(e);
            }
         }
         if (tmp.getListeners() == null)
         {
            tmp.setListeners(EMPTY_LISTENER_LIST);
         }
         if (tmp.getFilters() == null)
         {
            tmp.setFilters(EMPTY_FILTER_MAP);
         }
         for (FilterMetaData filterMD : tmp.getFilters().values())
         {
            if (filterMD.getInitParams() == null)
            {
               filterMD.setInitParams(EMPTY_INIT_PARAM_LIST);
            }
         }
         if (tmp.getFilterMapping() == null)
         {
            tmp.setFilterMapping(EMPTY_FILTER_MAPPING_LIST);
         }
         if (tmp.getContainerRuntimeOptions() == null)
         {
            tmp.setContainerRuntimeOptions(EMPTY_CONTAINER_RUNTIME_OPTION_MAP);
         }
      }

      //
      if (portletApplicationMD.getCustomPortletModes() == null)
View Full Code Here

      String defaultNamespace = XMLConstants.NULL_NS_URI;
      List<ContainerListenerInfo> listeners = Collections.emptyList();
      Map<String, ContainerFilterInfo> allFilters = new HashMap<String, ContainerFilterInfo>();
      if (this.portletApplicationMD instanceof PortletApplication20MetaData)
      {
         PortletApplication20MetaData tmp = (PortletApplication20MetaData)this.portletApplicationMD;

         //
         defaultNamespace = tmp.getDefaultNamespace() != null ? tmp.getDefaultNamespace().toString() : null;

         //
         for (EventDefinitionMetaData eventDefinitionMD : tmp.getEvents())
         {
            try
            {
               ContainerEventInfo event = build(eventDefinitionMD);
               events.put(event.getName(), event);
            }
            catch (NoSuchClassException e)
            {
//               log.error("Cannot load event class " + e.getClassName(), e);
            }
         }

         //
         for (PublicRenderParameterMetaData parameterMD : tmp.getPublicRenderParameters())
         {
            ContainerParameterInfo parameter = build(parameterMD);

            //
            publicParameters.put(parameter.getId(), parameter);
         }

         //
         Map<String, RuntimeOptionInfo> applicationOptions = build(tmp.getContainerRuntimeOptions().values());
         if (applicationOptions != null)
         {
            this.applicationOptions.putAll(applicationOptions);
         }

         //
         listeners = new ArrayList<ContainerListenerInfo>(tmp.getListeners().size());
         for (ListenerMetaData listenerMD : tmp.getListeners())
         {
            ContainerListenerInfo listener = build(listenerMD);
            listeners.add(listener);
         }
         listeners = Collections.unmodifiableList(listeners);

         //
         for (FilterMetaData filterMD : tmp.getFilterCollection())
         {
            ContainerFilterInfo filter = build(filterMD);
            allFilters.put(filter.getName(), filter);
         }
      }
View Full Code Here

TOP

Related Classes of org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData

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.