Forums.java :  » Groupware » hipergate » com » knowgate » forums » Java Open Source

Java Open Source » Groupware » hipergate 
hipergate » com » knowgate » forums » Forums.java
package com.knowgate.forums;

import java.sql.SQLException;

import com.knowgate.debug.DebugFile;
import com.knowgate.jdc.JDCConnection;
import com.knowgate.dataobjs.DB;
import com.knowgate.dataobjs.DBSubset;

/**
 * <p>Forums Model Class</p>
 * @author Sergio Montoro Ten
 * @version 2.0
 */

public class Forums {
  public Forums() {
  }

  public String RSSListNewsGroups(JDCConnection oConn, int iDomainId, String sWorkAreaId)
    throws SQLException {

    if (DebugFile.trace) {
      DebugFile.writeln("Begin Forums.RSSListNewsGroups(" + String.valueOf(iDomainId) + "," + sWorkAreaId + ")");
      DebugFile.incIdent();
    }

    String sWhere = "g." + DB.id_domain + "=" + String.valueOf(iDomainId);

    if (null!=sWorkAreaId)
      sWhere += " AND g." + DB.gu_workarea + "=" + String.valueOf(sWorkAreaId);

    DBSubset oNewsGrps = new DBSubset(DB.k_newsgroups + " g," + DB.k_categories + " c",
                                      "g." + DB.gu_newsgrp + ",g." + DB.id_domain +
                                      ",g." + DB.gu_workarea + ",g." + DB.dt_created +
                                      ",g." + DB.bo_binaries + ",g." + DB.dt_expire +
                                      ",g." + DB.de_newsgrp + ",c." + DB.nm_category +
                                      ",c." + DB.bo_active + ",c." + DB.dt_modified +
                                      ",c." + DB.nm_icon + ",c." + DB.nm_icon2, sWhere, 10);

    final int iNewsGrps = oNewsGrps.load(oConn);

    StringBuffer oStrBuff = new StringBuffer();

    oStrBuff.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");

    oStrBuff.append("<!DOCTYPE rdf:RDF [\n");
    oStrBuff.append("<!ENTITY % HTMLsymbol PUBLIC \"-//W3C//ENTITIES Symbols for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent\"> %HTMLsymbol;\n");
    oStrBuff.append("<!ENTITY % HTMLspecial PUBLIC \"-//W3C//ENTITIES Specials for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent\"> %HTMLspecial;\n");
    oStrBuff.append("<!ENTITY % HTMLlatin1 PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\"> %HTMLlatin1;\n");
    oStrBuff.append("]>\n");

    oStrBuff.append("<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns=\"http://purl.org/rss/1.0/\">\n");
    oStrBuff.append("  <channel rdf:about=\"http://www.hipergate.org/newsgroups\">\n");
    oStrBuff.append("    <title>NewsGroups List</title>\n");
    oStrBuff.append("  </channel>\n");
    oStrBuff.append("</rdf:RDF>");

    for (int n=0; n<iNewsGrps; n++) {

    } // next (n)

    return oStrBuff.toString();
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.