portletApplicationDefinition.setWebApplicationDefinition(webApplicationDefinition);
return portletApplicationDefinition;
}
private PortletDefinitionList getPortletDefinitions(Element portletAppE, WebApplicationDefinition webApplicationDefinition) {
PortletDefinitionListImpl portletDefinitions = new PortletDefinitionListImpl();
NodeList portletNL = portletAppE.getElementsByTagName("portlet");
for (int i = 0; i < portletNL.getLength(); i += 1) {
Element portletE = (Element)portletNL.item(i);
String portletName = XML.getChildElementText(portletE, "portlet-name");
String portletDefinitionId = contextName + "." + portletName;
PortletDefinitionImpl portletDefinition = new PortletDefinitionImpl();
portletDefinition.setId(portletDefinitionId);
portletDefinition.setClassName(XML.getChildElementText(portletE, "portlet-class"));
portletDefinition.setName(portletName);
portletDefinition.setDisplayNames(getDisplayNames(portletE));
portletDefinition.setDescriptions(getDescriptions(portletE));
portletDefinition.setLanguages(getLanguages(portletE));
portletDefinition.setInitParameters(getInitParameters(portletE));
portletDefinition.setPreferences(getPreferences(portletE));
portletDefinition.setContentTypes(getContentTypes(portletE));
portletDefinition.setServletDefinition(webApplicationDefinition.getServletDefinitionList().get(portletName));
portletDefinition.setPortletApplicationDefinition(portletApplicationDefinition);
portletDefinition.setExpirationCache(XML.getChildElementText(portletE, "expiration-cache"));
portletDefinition.setInitSecurityRoleRefSet(getSecurityRoleRefs(portletE));
portletDefinitions.add(portletDefinitionId, portletDefinition);
}
return portletDefinitions;
}