// modified by YCLI: START :: to ignore extra elements and attributes
unmarshaller.setIgnoreExtraElements(true);
unmarshaller.setIgnoreExtraAttributes(true);
// modified by YCLI: END
PortletApplicationDefinitionImpl portletApp =
(PortletApplicationDefinitionImpl) unmarshaller.unmarshal(
portletDocument);
// refill structure with necessary information
Vector structure = new Vector();
structure.add(webModule);
structure.add(null);
structure.add(null);
portletApp.preBuild(structure);
if (debug) {
System.out.println(portletApp);
}
// now generate web part
WebApplicationDefinitionImpl webApp = null;
if (webXml.exists()) {
org.w3c.dom.Document webDocument =
XmlParser.parseWebXml(new FileInputStream(webXml));
Unmarshaller unmarshallerWeb = new Unmarshaller(mappingWebXml);
// modified by YCLI: START :: to ignore extra elements and attributes
unmarshallerWeb.setIgnoreExtraElements(true);
unmarshallerWeb.setIgnoreExtraAttributes(true);
// modified by YCLI: END
webApp =
(WebApplicationDefinitionImpl) unmarshallerWeb.unmarshal(
webDocument);
} else {
webApp = new WebApplicationDefinitionImpl();
DisplayNameImpl dispName = new DisplayNameImpl();
dispName.setDisplayName(webModule);
dispName.setLocale(Locale.ENGLISH);
DisplayNameSetImpl dispSet = new DisplayNameSetImpl();
dispSet.add(dispName);
webApp.setDisplayNames(dispSet);
DescriptionImpl desc = new DescriptionImpl();
desc.setDescription("Automated generated Application Wrapper");
desc.setLocale(Locale.ENGLISH);
DescriptionSetImpl descSet = new DescriptionSetImpl();
descSet.add(desc);
webApp.setDescriptions(descSet);
}
org.apache.pluto.om.ControllerFactory controllerFactory =
new org.apache.pluto.portalImpl.om.ControllerFactoryImpl();
ServletDefinitionListCtrl servletDefinitionSetCtrl =
(ServletDefinitionListCtrl) controllerFactory.get(
webApp.getServletDefinitionList());
Collection servletMappings = webApp.getServletMappings();
Iterator portlets =
portletApp.getPortletDefinitionList().iterator();
while (portlets.hasNext()) {
PortletDefinition portlet = (PortletDefinition) portlets.next();
// check if already exists