* @param out a sax document handler
* @param uid a unique ID used to identify the state of the channel
*/
public void renderXML (ContentHandler out, String uid) throws PortalException {
ChannelState channelState = (ChannelState)channelStateMap.get(uid);
ChannelStaticData staticData = channelState.getStaticData();
ChannelRuntimeData runtimeData = channelState.getRuntimeData();
Document doc = null;
try {
doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
} catch (ParserConfigurationException pce) {
log.error("Error obtaining a Document", pce);
throw new GeneralRenderingException(pce);
}
// Create XML doc
Element appletE = doc.createElement("applet");
appletE.setAttribute("code", staticData.getParameter("code"));
appletE.setAttribute("codebase", staticData.getParameter("codeBase"));
appletE.setAttribute("width", staticData.getParameter("width"));
appletE.setAttribute("height", staticData.getParameter("height"));
appletE.setAttribute("align", "top");
appletE.setAttribute("border", "0");
appletE.setAttribute("archive", staticData.getParameter("archive"));
// Take all parameters whose names start with "APPLET." and pass them
// to the applet (after stripping "APPLET.")
java.util.Enumeration allKeys = staticData.keys ();
while (allKeys.hasMoreElements()) {
String p = (String)allKeys.nextElement();
if (p.startsWith ("APPLET.")) {
Element paramE = doc.createElement("param");
paramE.setAttribute("name", p.substring(7) /*skip "APPLET."*/);
paramE.setAttribute("value", (String)staticData.getParameter(p));
appletE.appendChild(paramE);
}
}
doc.appendChild(appletE);