001: /*
002: Copyright (C) 2003 Know Gate S.L. All rights reserved.
003: C/Oņa, 107 1š2 28050 Madrid (Spain)
004:
005: Redistribution and use in source and binary forms, with or without
006: modification, are permitted provided that the following conditions
007: are met:
008:
009: 1. Redistributions of source code must retain the above copyright
010: notice, this list of conditions and the following disclaimer.
011:
012: 2. The end-user documentation included with the redistribution,
013: if any, must include the following acknowledgment:
014: "This product includes software parts from hipergate
015: (http://www.hipergate.org/)."
016: Alternately, this acknowledgment may appear in the software itself,
017: if and wherever such third-party acknowledgments normally appear.
018:
019: 3. The name hipergate must not be used to endorse or promote products
020: derived from this software without prior written permission.
021: Products derived from this software may not be called hipergate,
022: nor may hipergate appear in their name, without prior written
023: permission.
024:
025: This library is distributed in the hope that it will be useful,
026: but WITHOUT ANY WARRANTY; without even the implied warranty of
027: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
028:
029: You should have received a copy of hipergate License with this code;
030: if not, visit http://www.hipergate.org or mail to info@hipergate.org
031: */
032:
033: package com.knowgate.dataxslt;
034:
035: import java.util.Vector;
036:
037: import org.w3c.dom.Element;
038: import org.w3c.dom.Node;
039: import org.w3c.dom.NodeList;
040:
041: import dom.DOMSubDocument;
042:
043: /**
044: * <p>Microsite Container</p>
045: * @author Sergio Montoro Ten
046: * @version 1.0
047: */
048: public class Container extends DOMSubDocument {
049:
050: // ----------------------------------------------------------
051:
052: public Container(Node oRefNode) {
053: super (oRefNode);
054: }
055:
056: // ----------------------------------------------------------
057:
058: public String guid() {
059: Node oItem = oNode.getAttributes().getNamedItem("guid");
060:
061: if (null == oItem)
062: return null;
063: else
064: return oItem.getNodeValue();
065: } // guid()
066:
067: // ----------------------------------------------------------
068:
069: public String name() {
070: return getElement("name");
071: } // name
072:
073: // ----------------------------------------------------------
074:
075: public String template() {
076: return getElement("template");
077: } // name
078:
079: // ----------------------------------------------------------
080:
081: public String thumbnail() {
082: return getElement("thumbnail");
083: } // thumbnail
084:
085: // ----------------------------------------------------------
086:
087: public String parameters() {
088: return getElement("parameters");
089: } // parameters
090:
091: // ----------------------------------------------------------
092:
093: public Vector metablocks() {
094: Node oMetaBlksNode = null;
095: NodeList oNodeList;
096: Vector oLinkVctr;
097:
098: for (oMetaBlksNode = oNode.getFirstChild(); oMetaBlksNode != null; oMetaBlksNode = oMetaBlksNode
099: .getNextSibling())
100: if (Node.ELEMENT_NODE == oMetaBlksNode.getNodeType())
101: if (oMetaBlksNode.getNodeName().equals("metablocks"))
102: break;
103:
104: oNodeList = ((Element) oMetaBlksNode)
105: .getElementsByTagName("metablock");
106:
107: oLinkVctr = new Vector(oNodeList.getLength());
108:
109: for (int i = 0; i < oNodeList.getLength(); i++)
110: oLinkVctr.add(new MetaBlock(oNodeList.item(i)));
111:
112: return oLinkVctr;
113: } // metablocks()
114:
115: // ----------------------------------------------------------
116: }
|