}
// portlet app
if (parent instanceof PortletApplication10MetaData)
{
PortletApplication10MetaData md = (PortletApplication10MetaData)parent;
// add portlet
if (child instanceof PortletMetaData)
{
PortletMetaData portlet = (PortletMetaData)child;
portlet.setDisplayName(this.displayNames.getLocalizedString(portlet));
md.addPortlet(portlet);
}
// add custom-portlet-mode
else if (child instanceof CustomPortletModeMetaData)
{
md.addCustomPortletMode((CustomPortletModeMetaData)child);
}
// add custom window state
else if (child instanceof CustomWindowStateMetaData)
{
md.addCustomWindowState((CustomWindowStateMetaData)child);
}
// add user-attribute
else if (child instanceof UserAttributeMetaData)
{
md.addUserAttribute((UserAttributeMetaData)child);
}
// add security-constraint
else if (child instanceof SecurityConstraintMetaData)
{
SecurityConstraintMetaData security = (SecurityConstraintMetaData)child;
// display-name
security.setDisplayName(this.displayNames.getLocalizedString(security));
md.addSecurityConstraint(security);
}
}
// 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);
}
}
}