1 package com.knowgate.forums; 2 3 import java.sql.SQLException ; 4 5 import com.knowgate.debug.DebugFile; 6 import com.knowgate.jdc.JDCConnection; 7 import com.knowgate.dataobjs.DB; 8 import com.knowgate.dataobjs.DBSubset; 9 10 15 16 public class Forums { 17 public Forums() { 18 } 19 20 public String RSSListNewsGroups(JDCConnection oConn, int iDomainId, String sWorkAreaId) 21 throws SQLException { 22 23 if (DebugFile.trace) { 24 DebugFile.writeln("Begin Forums.RSSListNewsGroups(" + String.valueOf(iDomainId) + "," + sWorkAreaId + ")"); 25 DebugFile.incIdent(); 26 } 27 28 String sWhere = "g." + DB.id_domain + "=" + String.valueOf(iDomainId); 29 30 if (null!=sWorkAreaId) 31 sWhere += " AND g." + DB.gu_workarea + "=" + String.valueOf(sWorkAreaId); 32 33 DBSubset oNewsGrps = new DBSubset(DB.k_newsgroups + " g," + DB.k_categories + " c", 34 "g." + DB.gu_newsgrp + ",g." + DB.id_domain + 35 ",g." + DB.gu_workarea + ",g." + DB.dt_created + 36 ",g." + DB.bo_binaries + ",g." + DB.dt_expire + 37 ",g." + DB.de_newsgrp + ",c." + DB.nm_category + 38 ",c." + DB.bo_active + ",c." + DB.dt_modified + 39 ",c." + DB.nm_icon + ",c." + DB.nm_icon2, sWhere, 10); 40 41 final int iNewsGrps = oNewsGrps.load(oConn); 42 43 StringBuffer oStrBuff = new StringBuffer (); 44 45 oStrBuff.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); 46 47 oStrBuff.append("<!DOCTYPE rdf:RDF [\n"); 48 oStrBuff.append("<!ENTITY % HTMLsymbol PUBLIC \"-//W3C//ENTITIES Symbols for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent\"> %HTMLsymbol;\n"); 49 oStrBuff.append("<!ENTITY % HTMLspecial PUBLIC \"-//W3C//ENTITIES Specials for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent\"> %HTMLspecial;\n"); 50 oStrBuff.append("<!ENTITY % HTMLlatin1 PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\"> %HTMLlatin1;\n"); 51 oStrBuff.append("]>\n"); 52 53 oStrBuff.append("<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns=\"http://purl.org/rss/1.0/\">\n"); 54 oStrBuff.append(" <channel rdf:about=\"http://www.hipergate.org/newsgroups\">\n"); 55 oStrBuff.append(" <title>NewsGroups List</title>\n"); 56 oStrBuff.append(" </channel>\n"); 57 oStrBuff.append("</rdf:RDF>"); 58 59 for (int n=0; n<iNewsGrps; n++) { 60 61 } 63 return oStrBuff.toString(); 64 } 65 } | Popular Tags |