1 9 package org.jboss.portal.setup.impl.dl.cmsloader; 10 11 import org.jboss.portal.setup.impl.dl.StatementMetaData; 12 import org.jboss.portal.setup.impl.dl.StatementType; 13 import org.jboss.portal.setup.PortalSetupException; 14 import org.jboss.portal.setup.CmsSetupException; 15 import org.jboss.portal.common.util.XML; 16 import org.w3c.dom.Element ; 17 18 import java.util.List ; 19 import java.util.ArrayList ; 20 21 27 public class CmsStatementMetaData extends StatementMetaData 28 { 29 private StatementType m_type = null; 30 private List m_contents = new ArrayList (); 31 32 CmsStatementMetaData(Element statement) throws PortalSetupException 33 { 34 super(statement); 35 buildMetaData(statement); 36 } 37 38 41 public StatementType getType() 42 { 43 return m_type; 44 } 45 46 public List getContents() 47 { 48 return m_contents; 49 } 50 51 55 protected void buildMetaData(Element config) throws PortalSetupException 56 { 57 String strType = XML.asString(XML.getUniqueChild(config, "type", true)); 58 m_type = StatementType.parseString(strType); 59 60 List contentDef = XML.getChildren(config, "content"); 61 62 for (int i = 0; i < contentDef.size(); i++) 63 { 64 Element content = (Element )contentDef.get(i); 65 66 m_contents.add(buildContentMetaData(content)); 67 } 68 69 70 } 71 72 private ContentMetaData buildContentMetaData(Element content) 73 { 74 return new ContentMetaData(content); 75 76 } 77 78 } 79 | Popular Tags |