1 9 package org.jboss.portal.core.metadata; 10 11 import org.jboss.portal.common.util.XML; 12 import org.jboss.portal.common.transaction.Transactions; 13 import org.jboss.portal.portlet.metadata.PortletApplicationMetaData; 14 import org.jboss.portal.portlet.metadata.PortletMetaData; 15 import org.w3c.dom.Document ; 16 import org.w3c.dom.Element ; 17 18 import java.util.List ; 19 20 27 public class CorePortletApplicationBuilder 28 { 29 30 public void importXML(PortletApplicationMetaData applicationMD, Document doc) 31 { 32 Element portletAppElt = doc.getDocumentElement(); 33 List portletElts = XML.getChildren(portletAppElt, "portlet"); 34 for (int i = 0;i < portletElts.size();i++) 35 { 36 Element portletElt = (Element )portletElts.get(i); 37 String portletName = XML.asString(XML.getUniqueChild(portletElt, "portlet-name", true)); 38 PortletMetaData portletMD = (PortletMetaData)applicationMD.getComponent(portletName); 39 if (portletMD != null) 40 { 41 importXML(portletMD, portletElt); 42 } 43 else 44 { 45 } 46 } 47 } 48 49 public void importXML(PortletMetaData portletMD, Element portletElt) 50 { 51 Element portletPreferencesElt = XML.getUniqueChild(portletElt, "portlet-preferences", false); 53 if (portletPreferencesElt != null) 54 { 55 Element proxyClassElt = XML.getUniqueChild(portletPreferencesElt, "proxy-class", false); 56 if (proxyClassElt != null) 57 { 58 ProxyPreferenceSetMetaData ppsmd = new ProxyPreferenceSetMetaData(); 59 String proxyClass = XML.asString(proxyClassElt); 60 ppsmd.setProxyClassName(proxyClass); 61 portletMD.addPlugin("PROXY", ppsmd); 62 } 63 } 64 } 65 } 66 | Popular Tags |