try {
org.w3c.dom.Document portletDocument =
XmlParser.parsePortletXml(new FileInputStream(portletXml));
Unmarshaller unmarshaller = new Unmarshaller(mappingPortletXml);
// 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);