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